<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP                 #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts    #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE OverloadedStrings   #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE Rank2Types          #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  Distribution.PackageDescription.Parsec</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  Isaac Jones 2003-2005</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  BSD3</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  cabal-devel@haskell.org</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- This defined parsers and partial pretty printers for the @.cabal@ format.</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.PackageDescription.Parsec</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-18"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Package descriptions</span></span><span>
</span><span id="line-19"></span><span>    </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#readGenericPackageDescription"><span class="hs-identifier">readGenericPackageDescription</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescription"><span class="hs-identifier">parseGenericPackageDescription</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>    </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescriptionMaybe"><span class="hs-identifier">parseGenericPackageDescriptionMaybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Parsing</span></span><span>
</span><span id="line-24"></span><span>    </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier">ParseResult</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>    </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#runParseResult"><span class="hs-identifier">runParseResult</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span>    </span><span class="annot"><span class="hs-comment">-- * New-style spec-version</span></span><span>
</span><span id="line-28"></span><span>    </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#scanSpecVersion"><span class="hs-identifier">scanSpecVersion</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Supplementary build information</span></span><span>
</span><span id="line-31"></span><span>    </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#readHookedBuildInfo"><span class="hs-identifier">readHookedBuildInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>    </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseHookedBuildInfo"><span class="hs-identifier">parseHookedBuildInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.State.Strict.html#"><span class="hs-identifier">Control.Monad.State.Strict</span></a></span><span>                    </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier">StateT</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#execStateT"><span class="hs-identifier">execStateT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Class.html#"><span class="hs-identifier">Control.Monad.Trans.Class</span></a></span><span>                     </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier">lift</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html"><span class="hs-identifier">Distribution.CabalSpecVersion</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Lens.html"><span class="hs-identifier">Distribution.Compat.Lens</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.html"><span class="hs-identifier">Distribution.FieldGrammar</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html"><span class="hs-identifier">Distribution.FieldGrammar.Parsec</span></a></span><span>              </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#NamelessField"><span class="hs-identifier">NamelessField</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Fields.ConfVar.html"><span class="hs-identifier">Distribution.Fields.ConfVar</span></a></span><span>                   </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.ConfVar.html#parseConditionConfVar"><span class="hs-identifier">parseConditionConfVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Fields.Field.html"><span class="hs-identifier">Distribution.Fields.Field</span></a></span><span>                     </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldName"><span class="hs-identifier">FieldName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.Field.html#getName"><span class="hs-identifier">getName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Fields.LexerMonad.html"><span class="hs-identifier">Distribution.Fields.LexerMonad</span></a></span><span>                </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexWarning"><span class="hs-identifier">LexWarning</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#toPWarnings"><span class="hs-identifier">toPWarnings</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html"><span class="hs-identifier">Distribution.Fields.Parser</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html"><span class="hs-identifier">Distribution.Fields.ParseResult</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.html"><span class="hs-identifier">Distribution.PackageDescription</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Configuration.html"><span class="hs-identifier">Distribution.PackageDescription.Configuration</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.PackageDescription.Configuration.html#freeVars"><span class="hs-identifier">freeVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Configuration.html#transformAllBuildInfos"><span class="hs-identifier">transformAllBuildInfos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.FieldGrammar.html"><span class="hs-identifier">Distribution.PackageDescription.FieldGrammar</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Quirks.html"><span class="hs-identifier">Distribution.PackageDescription.Quirks</span></a></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.PackageDescription.Quirks.html#patchQuirks"><span class="hs-identifier">patchQuirks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Parsec.html"><span class="hs-identifier">Distribution.Parsec</span></a></span><span>                           </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier">parsec</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Parsec.html#simpleParsecBS"><span class="hs-identifier">simpleParsecBS</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html"><span class="hs-identifier">Distribution.Parsec.FieldLineStream</span></a></span><span>           </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromBS"><span class="hs-identifier">fieldLineStreamFromBS</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html"><span class="hs-identifier">Distribution.Parsec.Position</span></a></span><span>                  </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier">Position</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier">zeroPos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Parsec.Warning.html"><span class="hs-identifier">Distribution.Parsec.Warning</span></a></span><span>                   </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.Warning.html#PWarnType"><span class="hs-identifier">PWarnType</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Pretty.html"><span class="hs-identifier">Distribution.Pretty</span></a></span><span>                           </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier">prettyShow</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html"><span class="hs-identifier">Distribution.Simple.Utils</span></a></span><span>                     </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.Generic.html#fromUTF8BS"><span class="hs-identifier">fromUTF8BS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.Generic.html#toUTF8BS"><span class="hs-identifier">toUTF8BS</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.Mixin.html"><span class="hs-identifier">Distribution.Types.Mixin</span></a></span><span>                      </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.Mixin.html#Mixin"><span class="hs-identifier">Mixin</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.Mixin.html#mkMixin"><span class="hs-identifier">mkMixin</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Utils.Generic.html"><span class="hs-identifier">Distribution.Utils.Generic</span></a></span><span>                    </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.Generic.html#breakMaybe"><span class="hs-identifier">breakMaybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.Generic.html#unfoldrM"><span class="hs-identifier">unfoldrM</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.Generic.html#validateUTF8"><span class="hs-identifier">validateUTF8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html"><span class="hs-identifier">Distribution.Verbosity</span></a></span><span>                        </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier">Verbosity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Version.html"><span class="hs-identifier">Distribution.Version</span></a></span><span>                          </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.Version.html#Version"><span class="hs-identifier">Version</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.Version.html#mkVersion"><span class="hs-identifier">mkVersion</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.Version.html#versionNumbers"><span class="hs-identifier">versionNumbers</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span>                                   </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span>                             </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS8</span></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Strict.html#"><span class="hs-identifier">Data.Map.Strict</span></a></span><span>                                   </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span>                                          </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Compat.Newtype.html"><span class="hs-identifier">Distribution.Compat.Newtype</span></a></span><span>                       </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Newtype</span></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Compat.NonEmptySet.html"><span class="hs-identifier">Distribution.Compat.NonEmptySet</span></a></span><span>                   </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">NES</span></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.Lens.html"><span class="hs-identifier">Distribution.Types.BuildInfo.Lens</span></a></span><span>                 </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Types.Executable.Lens.html"><span class="hs-identifier">Distribution.Types.Executable.Lens</span></a></span><span>                </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Types.ForeignLib.Lens.html"><span class="hs-identifier">Distribution.Types.ForeignLib.Lens</span></a></span><span>                </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.Lens.html"><span class="hs-identifier">Distribution.Types.GenericPackageDescription.Lens</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Types.PackageDescription.Lens.html"><span class="hs-identifier">Distribution.Types.PackageDescription.Lens</span></a></span><span>        </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Types.SetupBuildInfo.Lens.html"><span class="hs-identifier">Distribution.Types.SetupBuildInfo.Lens</span></a></span><span>            </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.html#"><span class="hs-identifier">Text.Parsec</span></a></span><span>                                       </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">P</span></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="hs-comment">-- ---------------------------------------------------------------</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- Parsing</span><span>
</span><span id="line-80"></span><span class="hs-comment">-- ---------------------------------------------------------------</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span class="hs-comment">-- | Parse the given package file.</span><span>
</span><span id="line-83"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#readGenericPackageDescription"><span class="hs-identifier hs-type">readGenericPackageDescription</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span>
</span><span id="line-84"></span><span id="readGenericPackageDescription"><span class="annot"><span class="annottext">readGenericPackageDescription :: Verbosity -&gt; String -&gt; IO GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#readGenericPackageDescription"><span class="hs-identifier hs-var hs-var">readGenericPackageDescription</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ParseResult GenericPackageDescription)
-&gt; Verbosity -&gt; String -&gt; IO GenericPackageDescription
forall a.
(ByteString -&gt; ParseResult a) -&gt; Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Fields.ParseResult.html#readAndParseFile"><span class="hs-identifier hs-var">readAndParseFile</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ParseResult GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescription"><span class="hs-identifier hs-var">parseGenericPackageDescription</span></a></span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-87"></span><span class="hs-comment">-- | Parses the given file into a 'GenericPackageDescription'.</span><span>
</span><span id="line-88"></span><span class="hs-comment">--</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- In Cabal 1.2 the syntax for package descriptions was changed to a format</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- with sections and possibly indented property descriptions.</span><span>
</span><span id="line-91"></span><span class="hs-comment">--</span><span>
</span><span id="line-92"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescription"><span class="hs-identifier hs-type">parseGenericPackageDescription</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span>
</span><span id="line-93"></span><span id="parseGenericPackageDescription"><span class="annot"><span class="annottext">parseGenericPackageDescription :: ByteString -&gt; ParseResult GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescription"><span class="hs-identifier hs-var hs-var">parseGenericPackageDescription</span></a></span></span><span> </span><span id="local-6989586621679702670"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702670"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-94"></span><span>    </span><span class="hs-comment">-- set scanned version</span><span>
</span><span id="line-95"></span><span>    </span><span class="annot"><span class="annottext">Maybe Version -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#setCabalSpecVersion"><span class="hs-identifier hs-var">setCabalSpecVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Version
</span><a href="#local-6989586621679702668"><span class="hs-identifier hs-var">ver</span></a></span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span>    </span><span id="local-6989586621679702667"><span class="annot"><span class="annottext">Maybe CabalSpecVersion
</span><a href="#local-6989586621679702667"><span class="hs-identifier hs-var">csv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Version
</span><a href="#local-6989586621679702668"><span class="hs-identifier hs-var">ver</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-98"></span><span>        </span><span class="hs-comment">-- if we get too new version, fail right away</span><span>
</span><span id="line-99"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679702666"><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679702666"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Maybe CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#cabalSpecFromVersionDigits"><span class="hs-identifier hs-var">cabalSpecFromVersionDigits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Version -&gt; [Int]
</span><a href="Distribution.Types.Version.html#versionNumbers"><span class="hs-identifier hs-var">versionNumbers</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679702666"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-100"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679702664"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702664"><span class="hs-identifier hs-var">csv</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe CabalSpecVersion -&gt; ParseResult (Maybe CabalSpecVersion)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; Maybe CabalSpecVersion
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702664"><span class="hs-identifier hs-var">csv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span>            </span><span class="annot"><span class="annottext">Maybe CabalSpecVersion
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult (Maybe CabalSpecVersion)
forall a. Position -&gt; String -&gt; ParseResult a
</span><a href="Distribution.Fields.ParseResult.html#parseFatalFailure"><span class="hs-identifier hs-var">parseFatalFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult (Maybe CabalSpecVersion))
-&gt; String -&gt; ParseResult (Maybe CabalSpecVersion)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-102"></span><span>                </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unsupported cabal-version &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Version -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679702666"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;. See https://github.com/haskell/cabal/issues/4899.&quot;</span></span><span>
</span><span id="line-103"></span><span>        </span><span class="annot"><span class="annottext">Maybe Version
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe CabalSpecVersion -&gt; ParseResult (Maybe CabalSpecVersion)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CabalSpecVersion
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Either ParseError ([Field Position], [LexWarning])
</span><a href="Distribution.Fields.Parser.html#readFields%27"><span class="hs-identifier hs-var">readFields'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702661"><span class="hs-identifier hs-var">bs''</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-106"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679702660"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702660"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702659"><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679702659"><span class="hs-identifier hs-var">lexWarnings</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-107"></span><span>            </span><span class="annot"><span class="annottext">Bool -&gt; ParseResult () -&gt; ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679702657"><span class="hs-identifier hs-var">patched</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; ParseResult ())
-&gt; ParseResult () -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-108"></span><span>                </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTQuirkyCabalFile"><span class="hs-identifier hs-var">PWTQuirkyCabalFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Legacy cabal file&quot;</span></span><span>
</span><span id="line-109"></span><span>            </span><span class="hs-comment">-- UTF8 is validated in a prepass step, afterwards parsing is lenient.</span><span>
</span><span id="line-110"></span><span>            </span><span class="annot"><span class="annottext">Maybe CabalSpecVersion
-&gt; [LexWarning]
-&gt; Maybe Int
-&gt; [Field Position]
-&gt; ParseResult GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescription%27"><span class="hs-identifier hs-var">parseGenericPackageDescription'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CabalSpecVersion
</span><a href="#local-6989586621679702667"><span class="hs-identifier hs-var">csv</span></a></span><span> </span><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679702659"><span class="hs-identifier hs-var">lexWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="#local-6989586621679702653"><span class="hs-identifier hs-var">invalidUtf8</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702660"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-111"></span><span>        </span><span class="hs-comment">-- TODO: better marshalling of errors</span><span>
</span><span id="line-112"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679702652"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679702652"><span class="hs-identifier hs-var">perr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult GenericPackageDescription
forall a. Position -&gt; String -&gt; ParseResult a
</span><a href="Distribution.Fields.ParseResult.html#parseFatalFailure"><span class="hs-identifier hs-var">parseFatalFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702651"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679702652"><span class="hs-identifier hs-var">perr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-113"></span><span>            </span><span id="local-6989586621679702649"><span class="annot"><span class="annottext">ppos :: SourcePos
</span><a href="#local-6989586621679702649"><span class="hs-identifier hs-var hs-var">ppos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseError -&gt; SourcePos
</span><a href="../../parsec/src/Text.Parsec.Error.html#errorPos"><span class="hs-identifier hs-var">P.errorPos</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679702652"><span class="hs-identifier hs-var">perr</span></a></span><span>
</span><span id="line-114"></span><span>            </span><span id="local-6989586621679702651"><span class="annot"><span class="annottext">pos :: Position
</span><a href="#local-6989586621679702651"><span class="hs-identifier hs-var hs-var">pos</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Position
</span><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-var">Position</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SourcePos -&gt; Int
</span><a href="../../parsec/src/Text.Parsec.Pos.html#sourceLine"><span class="hs-identifier hs-var">P.sourceLine</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679702649"><span class="hs-identifier hs-var">ppos</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SourcePos -&gt; Int
</span><a href="../../parsec/src/Text.Parsec.Pos.html#sourceColumn"><span class="hs-identifier hs-var">P.sourceColumn</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679702649"><span class="hs-identifier hs-var">ppos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-116"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679702657"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679702657"><span class="hs-identifier hs-var">patched</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702644"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702644"><span class="hs-identifier hs-var">bs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; (Bool, ByteString)
</span><a href="Distribution.PackageDescription.Quirks.html#patchQuirks"><span class="hs-identifier hs-var">patchQuirks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702670"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-117"></span><span>    </span><span id="local-6989586621679702668"><span class="annot"><span class="annottext">ver :: Maybe Version
</span><a href="#local-6989586621679702668"><span class="hs-identifier hs-var hs-var">ver</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe Version
</span><a href="Distribution.PackageDescription.Parsec.html#scanSpecVersion"><span class="hs-identifier hs-var">scanSpecVersion</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702644"><span class="hs-identifier hs-var">bs'</span></a></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span>    </span><span id="local-6989586621679702653"><span class="annot"><span class="annottext">invalidUtf8 :: Maybe Int
</span><a href="#local-6989586621679702653"><span class="hs-identifier hs-var hs-var">invalidUtf8</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe Int
</span><a href="Distribution.Utils.Generic.html#validateUTF8"><span class="hs-identifier hs-var">validateUTF8</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702644"><span class="hs-identifier hs-var">bs'</span></a></span><span>
</span><span id="line-120"></span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-comment">-- if there are invalid utf8 characters, we make the bytestring valid.</span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621679702661"><span class="annot"><span class="annottext">bs'' :: ByteString
</span><a href="#local-6989586621679702661"><span class="hs-identifier hs-var hs-var">bs''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="#local-6989586621679702653"><span class="hs-identifier hs-var">invalidUtf8</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-123"></span><span>        </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702644"><span class="hs-identifier hs-var">bs'</span></a></span><span>
</span><span id="line-124"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="Distribution.Utils.Generic.html#toUTF8BS"><span class="hs-identifier hs-var">toUTF8BS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; String
</span><a href="Distribution.Utils.Generic.html#fromUTF8BS"><span class="hs-identifier hs-var">fromUTF8BS</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702644"><span class="hs-identifier hs-var">bs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-comment">-- | 'Maybe' variant of 'parseGenericPackageDescription'</span><span>
</span><span id="line-128"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescriptionMaybe"><span class="hs-identifier hs-type">parseGenericPackageDescriptionMaybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span>
</span><span id="line-129"></span><span id="parseGenericPackageDescriptionMaybe"><span class="annot"><span class="annottext">parseGenericPackageDescriptionMaybe :: ByteString -&gt; Maybe GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescriptionMaybe"><span class="hs-identifier hs-var hs-var">parseGenericPackageDescriptionMaybe</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-130"></span><span>    </span><span class="annot"><span class="annottext">((Maybe Version, NonEmpty PError)
 -&gt; Maybe GenericPackageDescription)
-&gt; (GenericPackageDescription -&gt; Maybe GenericPackageDescription)
-&gt; Either
     (Maybe Version, NonEmpty PError) GenericPackageDescription
-&gt; Maybe GenericPackageDescription
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe GenericPackageDescription
-&gt; (Maybe Version, NonEmpty PError)
-&gt; Maybe GenericPackageDescription
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe GenericPackageDescription
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription -&gt; Maybe GenericPackageDescription
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(Either (Maybe Version, NonEmpty PError) GenericPackageDescription
 -&gt; Maybe GenericPackageDescription)
-&gt; (ByteString
    -&gt; Either
         (Maybe Version, NonEmpty PError) GenericPackageDescription)
-&gt; ByteString
-&gt; Maybe GenericPackageDescription
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([PWarning],
 Either (Maybe Version, NonEmpty PError) GenericPackageDescription)
-&gt; Either
     (Maybe Version, NonEmpty PError) GenericPackageDescription
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">(([PWarning],
  Either (Maybe Version, NonEmpty PError) GenericPackageDescription)
 -&gt; Either
      (Maybe Version, NonEmpty PError) GenericPackageDescription)
-&gt; (ByteString
    -&gt; ([PWarning],
        Either (Maybe Version, NonEmpty PError) GenericPackageDescription))
-&gt; ByteString
-&gt; Either
     (Maybe Version, NonEmpty PError) GenericPackageDescription
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ParseResult GenericPackageDescription
-&gt; ([PWarning],
    Either (Maybe Version, NonEmpty PError) GenericPackageDescription)
forall a.
ParseResult a
-&gt; ([PWarning], Either (Maybe Version, NonEmpty PError) a)
</span><a href="Distribution.Fields.ParseResult.html#runParseResult"><span class="hs-identifier hs-var">runParseResult</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult GenericPackageDescription
 -&gt; ([PWarning],
     Either (Maybe Version, NonEmpty PError) GenericPackageDescription))
-&gt; (ByteString -&gt; ParseResult GenericPackageDescription)
-&gt; ByteString
-&gt; ([PWarning],
    Either (Maybe Version, NonEmpty PError) GenericPackageDescription)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ParseResult GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescription"><span class="hs-identifier hs-var">parseGenericPackageDescription</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span id="local-6989586621679703708"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#fieldlinesToBS"><span class="hs-identifier hs-type">fieldlinesToBS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-type">FieldLine</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703708"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span></span><span>
</span><span id="line-133"></span><span id="fieldlinesToBS"><span class="annot"><span class="annottext">fieldlinesToBS :: forall ann. [FieldLine ann] -&gt; ByteString
</span><a href="Distribution.PackageDescription.Parsec.html#fieldlinesToBS"><span class="hs-identifier hs-var hs-var">fieldlinesToBS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#intercalate"><span class="hs-identifier hs-var">BS.intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">([ByteString] -&gt; ByteString)
-&gt; ([FieldLine ann] -&gt; [ByteString])
-&gt; [FieldLine ann]
-&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(FieldLine ann -&gt; ByteString) -&gt; [FieldLine ann] -&gt; [ByteString]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-type">FieldLine</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702636"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702636"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702636"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="hs-comment">-- Monad in which sections are parsed</span><span>
</span><span id="line-136"></span><span class="hs-keyword">type</span><span> </span><span id="SectionParser"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionParser"><span class="hs-identifier hs-var">SectionParser</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StateT</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-type">SectionS</span></a></span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="hs-comment">-- | State of section parser</span><span>
</span><span id="line-139"></span><span class="hs-keyword">data</span><span> </span><span id="SectionS"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-var">SectionS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="SectionS"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-var">SectionS</span></a></span></span><span>
</span><span id="line-140"></span><span>    </span><span class="hs-special">{</span><span> </span><span id="_stateGpd"><span class="annot"><span class="annottext">SectionS -&gt; GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#_stateGpd"><span class="hs-identifier hs-var hs-var">_stateGpd</span></a></span></span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span>
</span><span id="line-141"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_stateCommonStanzas"><span class="annot"><span class="annottext">SectionS -&gt; Map String CondTreeBuildInfo
</span><a href="Distribution.PackageDescription.Parsec.html#_stateCommonStanzas"><span class="hs-identifier hs-var hs-var">_stateCommonStanzas</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#CondTreeBuildInfo"><span class="hs-identifier hs-type">CondTreeBuildInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-type">stateGpd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.Lens.html#Lens%27"><span class="hs-identifier hs-type">Lens'</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-type">SectionS</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span>
</span><span id="line-145"></span><span id="stateGpd"><span class="annot"><span class="annottext">stateGpd :: Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var hs-var">stateGpd</span></a></span></span><span> </span><span id="local-6989586621679702629"><span class="annot"><span class="annottext">GenericPackageDescription -&gt; f GenericPackageDescription
</span><a href="#local-6989586621679702629"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-type">SectionS</span></a></span><span> </span><span id="local-6989586621679702628"><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702628"><span class="hs-identifier hs-var">gpd</span></a></span></span><span> </span><span id="local-6989586621679702627"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702627"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679702626"><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702626"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
-&gt; Map String CondTreeBuildInfo -&gt; SectionS
</span><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-var">SectionS</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702626"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702627"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(GenericPackageDescription -&gt; SectionS)
-&gt; f GenericPackageDescription -&gt; f SectionS
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription -&gt; f GenericPackageDescription
</span><a href="#local-6989586621679702629"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702628"><span class="hs-identifier hs-var">gpd</span></a></span><span>
</span><span id="line-146"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-pragma hs-type">stateGpd</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-type">stateCommonStanzas</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.Lens.html#Lens%27"><span class="hs-identifier hs-type">Lens'</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-type">SectionS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#CondTreeBuildInfo"><span class="hs-identifier hs-type">CondTreeBuildInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span id="stateCommonStanzas"><span class="annot"><span class="annottext">stateCommonStanzas :: Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var hs-var">stateCommonStanzas</span></a></span></span><span> </span><span id="local-6989586621679702621"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo -&gt; f (Map String CondTreeBuildInfo)
</span><a href="#local-6989586621679702621"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-type">SectionS</span></a></span><span> </span><span id="local-6989586621679702620"><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702620"><span class="hs-identifier hs-var">gpd</span></a></span></span><span> </span><span id="local-6989586621679702619"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702619"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
-&gt; Map String CondTreeBuildInfo -&gt; SectionS
</span><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-var">SectionS</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702620"><span class="hs-identifier hs-var">gpd</span></a></span><span> </span><span class="annot"><span class="annottext">(Map String CondTreeBuildInfo -&gt; SectionS)
-&gt; f (Map String CondTreeBuildInfo) -&gt; f SectionS
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo -&gt; f (Map String CondTreeBuildInfo)
</span><a href="#local-6989586621679702621"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702619"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-150"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-pragma hs-type">stateCommonStanzas</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="hs-comment">-- Note [Accumulating parser]</span><span>
</span><span id="line-153"></span><span class="hs-comment">--</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- This parser has two &quot;states&quot;:</span><span>
</span><span id="line-155"></span><span class="hs-comment">-- * first we parse fields of PackageDescription</span><span>
</span><span id="line-156"></span><span class="hs-comment">-- * then we parse sections (libraries, executables, etc)</span><span>
</span><span id="line-157"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescription%27"><span class="hs-identifier hs-type">parseGenericPackageDescription'</span></a></span><span>
</span><span id="line-158"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span>
</span><span id="line-159"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexWarning"><span class="hs-identifier hs-type">LexWarning</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-160"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-161"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-162"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span>
</span><span id="line-163"></span><span id="parseGenericPackageDescription%27"><span class="annot"><span class="annottext">parseGenericPackageDescription' :: Maybe CabalSpecVersion
-&gt; [LexWarning]
-&gt; Maybe Int
-&gt; [Field Position]
-&gt; ParseResult GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#parseGenericPackageDescription%27"><span class="hs-identifier hs-var hs-var">parseGenericPackageDescription'</span></a></span></span><span> </span><span id="local-6989586621679702618"><span class="annot"><span class="annottext">Maybe CabalSpecVersion
</span><a href="#local-6989586621679702618"><span class="hs-identifier hs-var">scannedVer</span></a></span></span><span> </span><span id="local-6989586621679702617"><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679702617"><span class="hs-identifier hs-var">lexWarnings</span></a></span></span><span> </span><span id="local-6989586621679702616"><span class="annot"><span class="annottext">Maybe Int
</span><a href="#local-6989586621679702616"><span class="hs-identifier hs-var">utf8WarnPos</span></a></span></span><span> </span><span id="local-6989586621679702615"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702615"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-164"></span><span>    </span><span class="annot"><span class="annottext">[PWarning] -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarnings"><span class="hs-identifier hs-var">parseWarnings</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LexWarning] -&gt; [PWarning]
</span><a href="Distribution.Fields.LexerMonad.html#toPWarnings"><span class="hs-identifier hs-var">toPWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679702617"><span class="hs-identifier hs-var">lexWarnings</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-165"></span><span>    </span><span class="annot"><span class="annottext">Maybe Int -&gt; (Int -&gt; ParseResult ()) -&gt; ParseResult ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
t a -&gt; (a -&gt; f b) -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#for_"><span class="hs-identifier hs-var">for_</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="#local-6989586621679702616"><span class="hs-identifier hs-var">utf8WarnPos</span></a></span><span> </span><span class="annot"><span class="annottext">((Int -&gt; ParseResult ()) -&gt; ParseResult ())
-&gt; (Int -&gt; ParseResult ()) -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679702612"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679702612"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-166"></span><span>        </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTUTF"><span class="hs-identifier hs-var">PWTUTF</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;UTF8 encoding problem at byte offset &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679702612"><span class="hs-identifier hs-var">pos</span></a></span><span>
</span><span id="line-167"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679702610"><span class="annot"><span class="annottext">Syntax
</span><a href="#local-6989586621679702610"><span class="hs-identifier hs-var">syntax</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702609"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702609"><span class="hs-identifier hs-var">fs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; (Syntax, [Field Position])
forall ann. [Field ann] -&gt; (Syntax, [Field ann])
</span><a href="Distribution.PackageDescription.Parsec.html#sectionizeFields"><span class="hs-identifier hs-var">sectionizeFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702615"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-168"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679702607"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679702607"><span class="hs-identifier hs-var">fields</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702606"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702606"><span class="hs-identifier hs-var">sectionFields</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; (Fields Position, [Field Position])
forall ann. [Field ann] -&gt; (Fields ann, [Field ann])
</span><a href="Distribution.FieldGrammar.html#takeFields"><span class="hs-identifier hs-var">takeFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702609"><span class="hs-identifier hs-var">fs'</span></a></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-comment">-- cabal-version</span><span>
</span><span id="line-171"></span><span>    </span><span id="local-6989586621679702604"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702604"><span class="hs-identifier hs-var">specVer</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe CabalSpecVersion
</span><a href="#local-6989586621679702618"><span class="hs-identifier hs-var">scannedVer</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-172"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679702603"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702603"><span class="hs-identifier hs-var">v</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; ParseResult CabalSpecVersion
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702603"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-173"></span><span>        </span><span class="annot"><span class="annottext">Maybe CabalSpecVersion
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Fields Position -&gt; Maybe [NamelessField Position]
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;cabal-version&quot;</span></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679702607"><span class="hs-identifier hs-var">fields</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [NamelessField Position]
-&gt; ([NamelessField Position] -&gt; Maybe (NamelessField Position))
-&gt; Maybe (NamelessField Position)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">[NamelessField Position] -&gt; Maybe (NamelessField Position)
forall a. [a] -&gt; Maybe a
</span><a href="#local-6989586621679702601"><span class="hs-identifier hs-var">safeLast</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-174"></span><span>            </span><span class="annot"><span class="annottext">Maybe (NamelessField Position)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; ParseResult CabalSpecVersion
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV1_0"><span class="hs-identifier hs-var">CabalSpecV1_0</span></a></span><span>
</span><span id="line-175"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#MkNamelessField"><span class="hs-identifier hs-type">MkNamelessField</span></a></span><span> </span><span id="local-6989586621679702598"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702598"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702597"><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679702597"><span class="hs-identifier hs-var">fls</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-176"></span><span>                </span><span class="hs-comment">-- version will be parsed twice, therefore we parse without warnings.</span><span>
</span><span id="line-177"></span><span>                </span><span id="local-6989586621679702596"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702596"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult CabalSpecVersion -&gt; ParseResult CabalSpecVersion
forall a. ParseResult a -&gt; ParseResult a
</span><a href="Distribution.Fields.ParseResult.html#withoutWarnings"><span class="hs-identifier hs-var">withoutWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult CabalSpecVersion -&gt; ParseResult CabalSpecVersion)
-&gt; ParseResult CabalSpecVersion -&gt; ParseResult CabalSpecVersion
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-178"></span><span>                    </span><span class="annot"><span class="annottext">(CabalSpecVersion -&gt; SpecVersion)
-&gt; SpecVersion -&gt; CabalSpecVersion
forall o n. Newtype o n =&gt; (o -&gt; n) -&gt; n -&gt; o
</span><a href="Distribution.Compat.Newtype.html#unpack%27"><span class="hs-identifier hs-var">Newtype.unpack'</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; SpecVersion
</span><a href="Distribution.FieldGrammar.Newtypes.html#SpecVersion"><span class="hs-identifier hs-var">SpecVersion</span></a></span><span> </span><span class="annot"><span class="annottext">(SpecVersion -&gt; CabalSpecVersion)
-&gt; ParseResult SpecVersion -&gt; ParseResult CabalSpecVersion
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span>
</span><span id="line-179"></span><span>                    </span><span class="hs-comment">-- Use version with || and &amp;&amp; but before addition of ^&gt;= and removal of -any</span><span>
</span><span id="line-180"></span><span>                    </span><span class="annot"><span class="annottext">Position
-&gt; ParsecParser SpecVersion
-&gt; CabalSpecVersion
-&gt; [FieldLine Position]
-&gt; ParseResult SpecVersion
forall a.
Position
-&gt; ParsecParser a
-&gt; CabalSpecVersion
-&gt; [FieldLine Position]
-&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#runFieldParser"><span class="hs-identifier hs-var">runFieldParser</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702598"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecParser SpecVersion
forall a (m :: * -&gt; *). (Parsec a, CabalParsing m) =&gt; m a
</span><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier hs-var">parsec</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV1_24"><span class="hs-identifier hs-var">CabalSpecV1_24</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679702597"><span class="hs-identifier hs-var">fls</span></a></span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span>                </span><span class="hs-comment">-- if it were at the beginning, scanner would found it</span><span>
</span><span id="line-183"></span><span>                </span><span class="annot"><span class="annottext">Bool -&gt; ParseResult () -&gt; ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702596"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV2_2"><span class="hs-identifier hs-var">CabalSpecV2_2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; ParseResult ())
-&gt; ParseResult () -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702598"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-184"></span><span>                    </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cabal-version should be at the beginning of the file starting with spec version 2.2. &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-185"></span><span>                    </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;See https://github.com/haskell/cabal/issues/4899&quot;</span></span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span>                </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; ParseResult CabalSpecVersion
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702596"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-comment">-- reset cabal version, it might not be set</span><span>
</span><span id="line-190"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702588"><span class="annot"><span class="annottext">specVer' :: Version
</span><a href="#local-6989586621679702588"><span class="hs-identifier hs-var hs-var">specVer'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Version
</span><a href="Distribution.Types.Version.html#mkVersion"><span class="hs-identifier hs-var">mkVersion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; [Int]
</span><a href="Distribution.CabalSpecVersion.html#cabalSpecToVersionDigits"><span class="hs-identifier hs-var">cabalSpecToVersionDigits</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702604"><span class="hs-identifier hs-var">specVer</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>    </span><span class="annot"><span class="annottext">Maybe Version -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#setCabalSpecVersion"><span class="hs-identifier hs-var">setCabalSpecVersion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Version -&gt; Maybe Version
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679702588"><span class="hs-identifier hs-var">specVer'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span>    </span><span class="hs-comment">-- Package description</span><span>
</span><span id="line-194"></span><span>    </span><span id="local-6989586621679702586"><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702586"><span class="hs-identifier hs-var">pd</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Fields Position
-&gt; ParsecFieldGrammar PackageDescription PackageDescription
-&gt; ParseResult PackageDescription
forall s a.
CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar s a -&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#parseFieldGrammar"><span class="hs-identifier hs-var">parseFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702604"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679702607"><span class="hs-identifier hs-var">fields</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar PackageDescription PackageDescription
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g PackageDescription),
 Applicative (g PackageIdentifier), c (Identity BuildType),
 c (Identity PackageName), c (Identity Version),
 c (List FSep FilePathNT String),
 c (List FSep TestedWith (CompilerFlavor, VersionRange)),
 c (List VCat FilePathNT String), c FilePathNT, c SpecLicense,
 c SpecVersion) =&gt;
g PackageDescription PackageDescription
</span><a href="Distribution.PackageDescription.FieldGrammar.html#packageDescriptionFieldGrammar"><span class="hs-identifier hs-var">packageDescriptionFieldGrammar</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span>    </span><span class="hs-comment">-- Check that scanned and parsed versions match.</span><span>
</span><span id="line-197"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; ParseResult () -&gt; ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702604"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">PackageDescription -&gt; CabalSpecVersion
</span><a href="Distribution.Types.PackageDescription.html#specVersion"><span class="hs-identifier hs-var hs-var">specVersion</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702586"><span class="hs-identifier hs-var">pd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; ParseResult ())
-&gt; ParseResult () -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-198"></span><span>        </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Scanned and parsed cabal-versions don't match &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-199"></span><span>        </span><span class="annot"><span class="annottext">SpecVersion -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; SpecVersion
</span><a href="Distribution.FieldGrammar.Newtypes.html#SpecVersion"><span class="hs-identifier hs-var">SpecVersion</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702604"><span class="hs-identifier hs-var">specVer</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; /= &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">SpecVersion -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; SpecVersion
</span><a href="Distribution.FieldGrammar.Newtypes.html#SpecVersion"><span class="hs-identifier hs-var">SpecVersion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription -&gt; CabalSpecVersion
</span><a href="Distribution.Types.PackageDescription.html#specVersion"><span class="hs-identifier hs-var hs-var">specVersion</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702586"><span class="hs-identifier hs-var">pd</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span>    </span><span class="annot"><span class="annottext">Syntax -&gt; PackageDescription -&gt; ParseResult ()
</span><a href="#local-6989586621679702581"><span class="hs-identifier hs-var">maybeWarnCabalVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Syntax
</span><a href="#local-6989586621679702610"><span class="hs-identifier hs-var">syntax</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702586"><span class="hs-identifier hs-var">pd</span></a></span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span>    </span><span class="hs-comment">-- Sections</span><span>
</span><span id="line-204"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702579"><span class="annot"><span class="annottext">gpd :: GenericPackageDescription
</span><a href="#local-6989586621679702579"><span class="hs-identifier hs-var hs-var">gpd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="Distribution.Types.GenericPackageDescription.html#emptyGenericPackageDescription"><span class="hs-identifier hs-var">emptyGenericPackageDescription</span></a></span><span>
</span><span id="line-205"></span><span>            </span><span class="annot"><span class="annottext">GenericPackageDescription
-&gt; (GenericPackageDescription -&gt; GenericPackageDescription)
-&gt; GenericPackageDescription
forall a b. a -&gt; (a -&gt; b) -&gt; b
</span><a href="Distribution.Compat.Lens.html#%26"><span class="hs-operator hs-var">&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  GenericPackageDescription
  GenericPackageDescription
  PackageDescription
  PackageDescription
Lens' GenericPackageDescription PackageDescription
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#packageDescription"><span class="hs-identifier hs-var">L.packageDescription</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  GenericPackageDescription
  GenericPackageDescription
  PackageDescription
  PackageDescription
-&gt; PackageDescription
-&gt; GenericPackageDescription
-&gt; GenericPackageDescription
forall s t a b. ASetter s t a b -&gt; b -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#.~"><span class="hs-operator hs-var">.~</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702586"><span class="hs-identifier hs-var">pd</span></a></span><span>
</span><span id="line-206"></span><span>    </span><span id="local-6989586621679702574"><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702574"><span class="hs-identifier hs-var">gpd1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  GenericPackageDescription SectionS GenericPackageDescription
-&gt; SectionS -&gt; GenericPackageDescription
forall a s. Getting a s a -&gt; s -&gt; a
</span><a href="Distribution.Compat.Lens.html#view"><span class="hs-identifier hs-var">view</span></a></span><span> </span><span class="annot"><span class="annottext">Getting
  GenericPackageDescription SectionS GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">(SectionS -&gt; GenericPackageDescription)
-&gt; ParseResult SectionS -&gt; ParseResult GenericPackageDescription
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">StateT SectionS ParseResult () -&gt; SectionS -&gt; ParseResult SectionS
forall (m :: * -&gt; *) s a. Monad m =&gt; StateT s m a -&gt; s -&gt; m s
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#execStateT"><span class="hs-identifier hs-var">execStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; [Field Position] -&gt; StateT SectionS ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#goSections"><span class="hs-identifier hs-var">goSections</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702604"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702606"><span class="hs-identifier hs-var">sectionFields</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericPackageDescription
-&gt; Map String CondTreeBuildInfo -&gt; SectionS
</span><a href="Distribution.PackageDescription.Parsec.html#SectionS"><span class="hs-identifier hs-var">SectionS</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702579"><span class="hs-identifier hs-var">gpd</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702570"><span class="annot"><span class="annottext">gpd2 :: GenericPackageDescription
</span><a href="#local-6989586621679702570"><span class="hs-identifier hs-var hs-var">gpd2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; GenericPackageDescription -&gt; GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#postProcessInternalDeps"><span class="hs-identifier hs-var">postProcessInternalDeps</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702604"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702574"><span class="hs-identifier hs-var">gpd1</span></a></span><span>
</span><span id="line-209"></span><span>    </span><span class="annot"><span class="annottext">GenericPackageDescription -&gt; ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#checkForUndefinedFlags"><span class="hs-identifier hs-var">checkForUndefinedFlags</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702570"><span class="hs-identifier hs-var">gpd2</span></a></span><span>
</span><span id="line-210"></span><span>    </span><span class="annot"><span class="annottext">GenericPackageDescription -&gt; ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#checkForUndefinedCustomSetup"><span class="hs-identifier hs-var">checkForUndefinedCustomSetup</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702570"><span class="hs-identifier hs-var">gpd2</span></a></span><span>
</span><span id="line-211"></span><span>    </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702570"><span class="hs-identifier hs-var">gpd2</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
-&gt; ParseResult GenericPackageDescription
-&gt; ParseResult GenericPackageDescription
forall a b. NFData a =&gt; a -&gt; b -&gt; b
</span><a href="../../deepseq/src/Control.DeepSeq.html#deepseq"><span class="hs-operator hs-var">`deepseq`</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription -&gt; ParseResult GenericPackageDescription
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702570"><span class="hs-identifier hs-var">gpd2</span></a></span><span>
</span><span id="line-212"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-213"></span><span>    </span><span id="local-6989586621679703685"><span class="annot"><a href="#local-6989586621679702601"><span class="hs-identifier hs-type">safeLast</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679703685"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703685"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-214"></span><span>    </span><span id="local-6989586621679702601"><span class="annot"><span class="annottext">safeLast :: forall a. [a] -&gt; Maybe a
</span><a href="#local-6989586621679702601"><span class="hs-identifier hs-var hs-var">safeLast</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Maybe a
forall a. [a] -&gt; Maybe a
</span><a href="../../base/src/Data.Maybe.html#listToMaybe"><span class="hs-identifier hs-var">listToMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; Maybe a) -&gt; ([a] -&gt; [a]) -&gt; [a] -&gt; Maybe a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span>    </span><span class="annot"><a href="#local-6989586621679702563"><span class="hs-identifier hs-type">newSyntaxVersion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span>
</span><span id="line-217"></span><span>    </span><span id="local-6989586621679702563"><span class="annot"><span class="annottext">newSyntaxVersion :: CabalSpecVersion
</span><a href="#local-6989586621679702563"><span class="hs-identifier hs-var hs-var">newSyntaxVersion</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV1_2"><span class="hs-identifier hs-var">CabalSpecV1_2</span></a></span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span>    </span><span class="annot"><a href="#local-6989586621679702581"><span class="hs-identifier hs-type">maybeWarnCabalVersion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#Syntax"><span class="hs-identifier hs-type">Syntax</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.PackageDescription.html#PackageDescription"><span class="hs-identifier hs-type">PackageDescription</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span>    </span><span id="local-6989586621679702581"><span class="annot"><span class="annottext">maybeWarnCabalVersion :: Syntax -&gt; PackageDescription -&gt; ParseResult ()
</span><a href="#local-6989586621679702581"><span class="hs-identifier hs-var hs-var">maybeWarnCabalVersion</span></a></span></span><span> </span><span id="local-6989586621679702561"><span class="annot"><span class="annottext">Syntax
</span><a href="#local-6989586621679702561"><span class="hs-identifier hs-var">syntax</span></a></span></span><span> </span><span id="local-6989586621679702560"><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702560"><span class="hs-identifier hs-var">pkg</span></a></span></span><span>
</span><span id="line-221"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Syntax
</span><a href="#local-6989586621679702561"><span class="hs-identifier hs-var">syntax</span></a></span><span> </span><span class="annot"><span class="annottext">Syntax -&gt; Syntax -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Syntax
</span><a href="Distribution.PackageDescription.Parsec.html#NewSyntax"><span class="hs-identifier hs-var">NewSyntax</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">PackageDescription -&gt; CabalSpecVersion
</span><a href="Distribution.Types.PackageDescription.html#specVersion"><span class="hs-identifier hs-var hs-var">specVersion</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702560"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702563"><span class="hs-identifier hs-var">newSyntaxVersion</span></a></span><span>
</span><span id="line-222"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTNewSyntax"><span class="hs-identifier hs-var">PWTNewSyntax</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-223"></span><span>             </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;A package using section syntax must specify at least\n&quot;</span></span><span>
</span><span id="line-224"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'cabal-version: &gt;= 1.2'.&quot;</span></span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span>    </span><span class="annot"><a href="#local-6989586621679702581"><span class="hs-identifier hs-var">maybeWarnCabalVersion</span></a></span><span> </span><span id="local-6989586621679702555"><span class="annot"><span class="annottext">Syntax
</span><a href="#local-6989586621679702555"><span class="hs-identifier hs-var">syntax</span></a></span></span><span> </span><span id="local-6989586621679702554"><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702554"><span class="hs-identifier hs-var">pkg</span></a></span></span><span>
</span><span id="line-227"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Syntax
</span><a href="#local-6989586621679702555"><span class="hs-identifier hs-var">syntax</span></a></span><span> </span><span class="annot"><span class="annottext">Syntax -&gt; Syntax -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Syntax
</span><a href="Distribution.PackageDescription.Parsec.html#OldSyntax"><span class="hs-identifier hs-var">OldSyntax</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">PackageDescription -&gt; CabalSpecVersion
</span><a href="Distribution.Types.PackageDescription.html#specVersion"><span class="hs-identifier hs-var hs-var">specVersion</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702554"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702563"><span class="hs-identifier hs-var">newSyntaxVersion</span></a></span><span>
</span><span id="line-228"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTOldSyntax"><span class="hs-identifier hs-var">PWTOldSyntax</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-229"></span><span>             </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;A package using 'cabal-version: &quot;</span></span><span>
</span><span id="line-230"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">SpecVersion -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; SpecVersion
</span><a href="Distribution.FieldGrammar.Newtypes.html#SpecVersion"><span class="hs-identifier hs-var">SpecVersion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription -&gt; CabalSpecVersion
</span><a href="Distribution.Types.PackageDescription.html#specVersion"><span class="hs-identifier hs-var hs-var">specVersion</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702554"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;' must use section syntax. See the Cabal user guide for details.&quot;</span></span><span>
</span><span id="line-232"></span><span>
</span><span id="line-233"></span><span>    </span><span class="annot"><a href="#local-6989586621679702581"><span class="hs-identifier hs-var">maybeWarnCabalVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Syntax
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; ParseResult ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#goSections"><span class="hs-identifier hs-type">goSections</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionParser"><span class="hs-identifier hs-type">SectionParser</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span id="goSections"><span class="annot"><span class="annottext">goSections :: CabalSpecVersion
-&gt; [Field Position] -&gt; StateT SectionS ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#goSections"><span class="hs-identifier hs-var hs-var">goSections</span></a></span></span><span> </span><span id="local-6989586621679702551"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702551"><span class="hs-identifier hs-var">specVer</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Field Position -&gt; StateT SectionS ParseResult ())
-&gt; [Field Position] -&gt; StateT SectionS ParseResult ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#traverse_"><span class="hs-identifier hs-var">traverse_</span></a></span><span> </span><span class="annot"><span class="annottext">Field Position -&gt; StateT SectionS ParseResult ()
</span><a href="#local-6989586621679702549"><span class="hs-identifier hs-var">process</span></a></span><span>
</span><span id="line-237"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-238"></span><span>    </span><span id="local-6989586621679702549"><span class="annot"><span class="annottext">process :: Field Position -&gt; StateT SectionS ParseResult ()
</span><a href="#local-6989586621679702549"><span class="hs-identifier hs-var hs-var">process</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702541"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702541"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702540"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702540"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-239"></span><span>        </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702541"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTTrailingFields"><span class="hs-identifier hs-var">PWTTrailingFields</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-240"></span><span>            </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ignoring trailing fields after sections: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702540"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-241"></span><span>    </span><span class="annot"><a href="#local-6989586621679702549"><span class="hs-identifier hs-var">process</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span> </span><span id="local-6989586621679702537"><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679702537"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679702536"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702536"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679702535"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702535"><span class="hs-identifier hs-var">secFields</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-242"></span><span>        </span><span class="annot"><span class="annottext">Name Position
-&gt; [SectionArg Position]
-&gt; [Field Position]
-&gt; StateT SectionS ParseResult ()
</span><a href="#local-6989586621679702534"><span class="hs-identifier hs-var">parseSection</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679702537"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702536"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702535"><span class="hs-identifier hs-var">secFields</span></a></span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span>    </span><span id="local-6989586621679702533"><span class="annot"><span class="annottext">snoc :: a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679702533"><span class="hs-identifier hs-var hs-var">snoc</span></a></span></span><span> </span><span id="local-6989586621679702532"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702532"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679702531"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679702531"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679702531"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702532"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-245"></span><span>
</span><span id="line-246"></span><span>    </span><span id="local-6989586621679702530"><span class="annot"><span class="annottext">hasCommonStanzas :: HasCommonStanzas
</span><a href="#local-6989586621679702530"><span class="hs-identifier hs-var hs-var">hasCommonStanzas</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; HasCommonStanzas
</span><a href="Distribution.CabalSpecVersion.html#specHasCommonStanzas"><span class="hs-identifier hs-var">specHasCommonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702551"><span class="hs-identifier hs-var">specVer</span></a></span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span>    </span><span class="hs-comment">-- we need signature, because this is polymorphic, but not-closed</span><span>
</span><span id="line-249"></span><span>    </span><span id="local-6989586621679703643"><span class="annot"><a href="#local-6989586621679702528"><span class="hs-identifier hs-type">parseCondTree'</span></a></span><span>
</span><span id="line-250"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.Lens.html#HasBuildInfo"><span class="hs-identifier hs-type">L.HasBuildInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703643"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-251"></span><span>        </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.html#ParsecFieldGrammar%27"><span class="hs-identifier hs-type">ParsecFieldGrammar'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703643"><span class="hs-identifier hs-type">a</span></a></span><span>       </span><span class="hs-comment">-- ^ grammar</span><span>
</span><span id="line-252"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679703643"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-253"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#CondTreeBuildInfo"><span class="hs-identifier hs-type">CondTreeBuildInfo</span></a></span><span>  </span><span class="hs-comment">-- ^ common stanzas</span><span>
</span><span id="line-254"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-255"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703643"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-256"></span><span>    </span><span id="local-6989586621679702528"><span class="annot"><span class="annottext">parseCondTree' :: forall a.
HasBuildInfo a =&gt;
ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702528"><span class="hs-identifier hs-var hs-var">parseCondTree'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
forall a.
HasBuildInfo a =&gt;
CabalSpecVersion
-&gt; ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="Distribution.PackageDescription.Parsec.html#parseCondTreeWithCommonStanzas"><span class="hs-identifier hs-var">parseCondTreeWithCommonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702551"><span class="hs-identifier hs-var">specVer</span></a></span><span>
</span><span id="line-257"></span><span>
</span><span id="line-258"></span><span>    </span><span class="annot"><a href="#local-6989586621679702534"><span class="hs-identifier hs-type">parseSection</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SectionArg"><span class="hs-identifier hs-type">SectionArg</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionParser"><span class="hs-identifier hs-type">SectionParser</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>    </span><span id="local-6989586621679702534"><span class="annot"><span class="annottext">parseSection :: Name Position
-&gt; [SectionArg Position]
-&gt; [Field Position]
-&gt; StateT SectionS ParseResult ()
</span><a href="#local-6989586621679702534"><span class="hs-identifier hs-var hs-var">parseSection</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702524"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702523"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679702522"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679702521"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span></span><span>
</span><span id="line-260"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HasCommonStanzas
</span><a href="#local-6989586621679702530"><span class="hs-identifier hs-var">hasCommonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">HasCommonStanzas -&gt; HasCommonStanzas -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HasCommonStanzas
</span><a href="Distribution.CabalSpecVersion.html#NoCommonStanzas"><span class="hs-identifier hs-var">NoCommonStanzas</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;common&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-261"></span><span>          </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTUnknownSection"><span class="hs-identifier hs-var">PWTUnknownSection</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ignoring section: common. You should set cabal-version: 2.2 or larger to use common stanzas.&quot;</span></span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;common&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-264"></span><span>            </span><span id="local-6989586621679702518"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702518"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
-&gt; StateT SectionS ParseResult (Map String CondTreeBuildInfo)
forall s (m :: * -&gt; *) a. MonadState s m =&gt; Getting a s a -&gt; m a
</span><a href="Distribution.Compat.Lens.html#use"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var">stateCommonStanzas</span></a></span><span>
</span><span id="line-265"></span><span>            </span><span id="local-6989586621679702516"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679702516"><span class="hs-identifier hs-var">name'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult String -&gt; StateT SectionS ParseResult String
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult String -&gt; StateT SectionS ParseResult String)
-&gt; ParseResult String -&gt; StateT SectionS ParseResult String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; [SectionArg Position] -&gt; ParseResult String
</span><a href="Distribution.PackageDescription.Parsec.html#parseCommonName"><span class="hs-identifier hs-var">parseCommonName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-266"></span><span>            </span><span id="local-6989586621679702514"><span class="annot"><span class="annottext">CondTreeBuildInfo
</span><a href="#local-6989586621679702514"><span class="hs-identifier hs-var">biTree</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult CondTreeBuildInfo
-&gt; StateT SectionS ParseResult CondTreeBuildInfo
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult CondTreeBuildInfo
 -&gt; StateT SectionS ParseResult CondTreeBuildInfo)
-&gt; ParseResult CondTreeBuildInfo
-&gt; StateT SectionS ParseResult CondTreeBuildInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' BuildInfo
-&gt; (BuildInfo -&gt; BuildInfo)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult CondTreeBuildInfo
forall a.
HasBuildInfo a =&gt;
ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702528"><span class="hs-identifier hs-var">parseCondTree'</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' BuildInfo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g BuildInfo),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
g BuildInfo BuildInfo
</span><a href="Distribution.PackageDescription.FieldGrammar.html#buildInfoFieldGrammar"><span class="hs-identifier hs-var">buildInfoFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; BuildInfo
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702518"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; Map String CondTreeBuildInfo -&gt; Maybe CondTreeBuildInfo
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679702516"><span class="hs-identifier hs-var">name'</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702518"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-269"></span><span>                </span><span class="annot"><span class="annottext">Maybe CondTreeBuildInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  (Map String CondTreeBuildInfo)
  (Map String CondTreeBuildInfo)
Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var">stateCommonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  (Map String CondTreeBuildInfo)
  (Map String CondTreeBuildInfo)
-&gt; Map String CondTreeBuildInfo -&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a b -&gt; b -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#.%3D"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">String
-&gt; CondTreeBuildInfo
-&gt; Map String CondTreeBuildInfo
-&gt; Map String CondTreeBuildInfo
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Strict.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679702516"><span class="hs-identifier hs-var">name'</span></a></span><span> </span><span class="annot"><span class="annottext">CondTreeBuildInfo
</span><a href="#local-6989586621679702514"><span class="hs-identifier hs-var">biTree</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702518"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span>
</span><span id="line-270"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CondTreeBuildInfo
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-271"></span><span>                    </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Duplicate common stanza: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679702516"><span class="hs-identifier hs-var">name'</span></a></span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;library&quot;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-274"></span><span>            </span><span id="local-6989586621679702508"><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] Library)
</span><a href="#local-6989586621679702508"><span class="hs-identifier hs-var">prev</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  (Maybe (CondTree ConfVar [Dependency] Library))
  SectionS
  (Maybe (CondTree ConfVar [Dependency] Library))
-&gt; StateT
     SectionS
     ParseResult
     (Maybe (CondTree ConfVar [Dependency] Library))
forall s (m :: * -&gt; *) a. MonadState s m =&gt; Getting a s a -&gt; m a
</span><a href="Distribution.Compat.Lens.html#use"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">(Getting
   (Maybe (CondTree ConfVar [Dependency] Library))
   SectionS
   (Maybe (CondTree ConfVar [Dependency] Library))
 -&gt; StateT
      SectionS
      ParseResult
      (Maybe (CondTree ConfVar [Dependency] Library)))
-&gt; Getting
     (Maybe (CondTree ConfVar [Dependency] Library))
     SectionS
     (Maybe (CondTree ConfVar [Dependency] Library))
-&gt; StateT
     SectionS
     ParseResult
     (Maybe (CondTree ConfVar [Dependency] Library))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  (Const (Maybe (CondTree ConfVar [Dependency] Library)))
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  (Const (Maybe (CondTree ConfVar [Dependency] Library)))
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; ((Maybe (CondTree ConfVar [Dependency] Library)
     -&gt; Const
          (Maybe (CondTree ConfVar [Dependency] Library))
          (Maybe (CondTree ConfVar [Dependency] Library)))
    -&gt; GenericPackageDescription
    -&gt; Const
         (Maybe (CondTree ConfVar [Dependency] Library))
         GenericPackageDescription)
-&gt; Getting
     (Maybe (CondTree ConfVar [Dependency] Library))
     SectionS
     (Maybe (CondTree ConfVar [Dependency] Library))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (CondTree ConfVar [Dependency] Library)
 -&gt; Const
      (Maybe (CondTree ConfVar [Dependency] Library))
      (Maybe (CondTree ConfVar [Dependency] Library)))
-&gt; GenericPackageDescription
-&gt; Const
     (Maybe (CondTree ConfVar [Dependency] Library))
     GenericPackageDescription
Lens'
  GenericPackageDescription
  (Maybe (CondTree ConfVar [Dependency] Library))
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#condLibrary"><span class="hs-identifier hs-var">L.condLibrary</span></a></span><span>
</span><span id="line-275"></span><span>            </span><span class="annot"><span class="annottext">Bool
-&gt; StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] Library) -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] Library)
</span><a href="#local-6989586621679702508"><span class="hs-identifier hs-var">prev</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-276"></span><span>                </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Multiple main libraries; have you forgotten to specify a name for an internal library?&quot;</span></span><span>
</span><span id="line-277"></span><span>
</span><span id="line-278"></span><span>            </span><span id="local-6989586621679702505"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702505"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
-&gt; StateT SectionS ParseResult (Map String CondTreeBuildInfo)
forall s (m :: * -&gt; *) a. MonadState s m =&gt; Getting a s a -&gt; m a
</span><a href="Distribution.Compat.Lens.html#use"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var">stateCommonStanzas</span></a></span><span>
</span><span id="line-279"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702504"><span class="annot"><span class="annottext">name'' :: LibraryName
</span><a href="#local-6989586621679702504"><span class="hs-identifier hs-var hs-var">name''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="Distribution.Types.LibraryName.html#LMainLibName"><span class="hs-identifier hs-var">LMainLibName</span></a></span><span>
</span><span id="line-280"></span><span>            </span><span id="local-6989586621679702502"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Library
</span><a href="#local-6989586621679702502"><span class="hs-identifier hs-var">lib</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult (CondTree ConfVar [Dependency] Library)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] Library)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult (CondTree ConfVar [Dependency] Library)
 -&gt; StateT
      SectionS ParseResult (CondTree ConfVar [Dependency] Library))
-&gt; ParseResult (CondTree ConfVar [Dependency] Library)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] Library)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' Library
-&gt; (BuildInfo -&gt; Library)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] Library)
forall a.
HasBuildInfo a =&gt;
ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702528"><span class="hs-identifier hs-var">parseCondTree'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LibraryName -&gt; ParsecFieldGrammar' Library
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g Library),
 Applicative (g BuildInfo), c (Identity LibraryVisibility),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List CommaVCat (Identity ModuleReexport) ModuleReexport),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
LibraryName -&gt; g Library Library
</span><a href="Distribution.PackageDescription.FieldGrammar.html#libraryFieldGrammar"><span class="hs-identifier hs-var">libraryFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679702504"><span class="hs-identifier hs-var">name''</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LibraryName -&gt; BuildInfo -&gt; Library
</span><a href="Distribution.PackageDescription.Parsec.html#libraryFromBuildInfo"><span class="hs-identifier hs-var">libraryFromBuildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679702504"><span class="hs-identifier hs-var">name''</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702505"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-281"></span><span>            </span><span class="hs-comment">--</span><span>
</span><span id="line-282"></span><span>            </span><span class="hs-comment">-- TODO check that not set</span><span>
</span><span id="line-283"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; ((Maybe (CondTree ConfVar [Dependency] Library)
     -&gt; Identity (Maybe (CondTree ConfVar [Dependency] Library)))
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; (Maybe (CondTree ConfVar [Dependency] Library)
    -&gt; Identity (Maybe (CondTree ConfVar [Dependency] Library)))
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (CondTree ConfVar [Dependency] Library)
 -&gt; Identity (Maybe (CondTree ConfVar [Dependency] Library)))
-&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription
Lens'
  GenericPackageDescription
  (Maybe (CondTree ConfVar [Dependency] Library))
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#condLibrary"><span class="hs-identifier hs-var">L.condLibrary</span></a></span><span> </span><span class="annot"><span class="annottext">((Maybe (CondTree ConfVar [Dependency] Library)
  -&gt; Identity (Maybe (CondTree ConfVar [Dependency] Library)))
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; CondTree ConfVar [Dependency] Library
-&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a (Maybe b) -&gt; b -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%3F%3D"><span class="hs-operator hs-var">?=</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Library
</span><a href="#local-6989586621679702502"><span class="hs-identifier hs-var">lib</span></a></span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span>        </span><span class="hs-comment">-- Sublibraries</span><span>
</span><span id="line-286"></span><span>        </span><span class="hs-comment">-- TODO: check cabal-version</span><span>
</span><span id="line-287"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;library&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-288"></span><span>            </span><span id="local-6989586621679702498"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702498"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
-&gt; StateT SectionS ParseResult (Map String CondTreeBuildInfo)
forall s (m :: * -&gt; *) a. MonadState s m =&gt; Getting a s a -&gt; m a
</span><a href="Distribution.Compat.Lens.html#use"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var">stateCommonStanzas</span></a></span><span>
</span><span id="line-289"></span><span>            </span><span id="local-6989586621679702497"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702497"><span class="hs-identifier hs-var">name'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Position
-&gt; [SectionArg Position] -&gt; SectionParser UnqualComponentName
</span><a href="Distribution.PackageDescription.Parsec.html#parseUnqualComponentName"><span class="hs-identifier hs-var">parseUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-290"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702495"><span class="annot"><span class="annottext">name'' :: LibraryName
</span><a href="#local-6989586621679702495"><span class="hs-identifier hs-var hs-var">name''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnqualComponentName -&gt; LibraryName
</span><a href="Distribution.Types.LibraryName.html#LSubLibName"><span class="hs-identifier hs-var">LSubLibName</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702497"><span class="hs-identifier hs-var">name'</span></a></span><span>
</span><span id="line-291"></span><span>            </span><span id="local-6989586621679702493"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Library
</span><a href="#local-6989586621679702493"><span class="hs-identifier hs-var">lib</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult (CondTree ConfVar [Dependency] Library)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] Library)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult (CondTree ConfVar [Dependency] Library)
 -&gt; StateT
      SectionS ParseResult (CondTree ConfVar [Dependency] Library))
-&gt; ParseResult (CondTree ConfVar [Dependency] Library)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] Library)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' Library
-&gt; (BuildInfo -&gt; Library)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] Library)
forall a.
HasBuildInfo a =&gt;
ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702528"><span class="hs-identifier hs-var">parseCondTree'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LibraryName -&gt; ParsecFieldGrammar' Library
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g Library),
 Applicative (g BuildInfo), c (Identity LibraryVisibility),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List CommaVCat (Identity ModuleReexport) ModuleReexport),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
LibraryName -&gt; g Library Library
</span><a href="Distribution.PackageDescription.FieldGrammar.html#libraryFieldGrammar"><span class="hs-identifier hs-var">libraryFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679702495"><span class="hs-identifier hs-var">name''</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LibraryName -&gt; BuildInfo -&gt; Library
</span><a href="Distribution.PackageDescription.Parsec.html#libraryFromBuildInfo"><span class="hs-identifier hs-var">libraryFromBuildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679702495"><span class="hs-identifier hs-var">name''</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702498"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-292"></span><span>            </span><span class="hs-comment">-- TODO check duplicate name here?</span><span>
</span><span id="line-293"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; (([(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
     -&gt; Identity
          [(UnqualComponentName, CondTree ConfVar [Dependency] Library)])
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; ([(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
    -&gt; Identity
         [(UnqualComponentName, CondTree ConfVar [Dependency] Library)])
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
 -&gt; Identity
      [(UnqualComponentName, CondTree ConfVar [Dependency] Library)])
-&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription
Lens'
  GenericPackageDescription
  [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#condSubLibraries"><span class="hs-identifier hs-var">L.condSubLibraries</span></a></span><span> </span><span class="annot"><span class="annottext">(([(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
  -&gt; Identity
       [(UnqualComponentName, CondTree ConfVar [Dependency] Library)])
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; ([(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
    -&gt; [(UnqualComponentName, CondTree ConfVar [Dependency] Library)])
-&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%25%3D"><span class="hs-operator hs-var">%=</span></a></span><span> </span><span class="annot"><span class="annottext">(UnqualComponentName, CondTree ConfVar [Dependency] Library)
-&gt; [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-&gt; [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
forall {a}. a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679702533"><span class="hs-identifier hs-var">snoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702497"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Library
</span><a href="#local-6989586621679702493"><span class="hs-identifier hs-var">lib</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span>
</span><span id="line-295"></span><span>        </span><span class="hs-comment">-- TODO: check cabal-version</span><span>
</span><span id="line-296"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;foreign-library&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-297"></span><span>            </span><span id="local-6989586621679702490"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702490"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
-&gt; StateT SectionS ParseResult (Map String CondTreeBuildInfo)
forall s (m :: * -&gt; *) a. MonadState s m =&gt; Getting a s a -&gt; m a
</span><a href="Distribution.Compat.Lens.html#use"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var">stateCommonStanzas</span></a></span><span>
</span><span id="line-298"></span><span>            </span><span id="local-6989586621679702489"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702489"><span class="hs-identifier hs-var">name'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Position
-&gt; [SectionArg Position] -&gt; SectionParser UnqualComponentName
</span><a href="Distribution.PackageDescription.Parsec.html#parseUnqualComponentName"><span class="hs-identifier hs-var">parseUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-299"></span><span>            </span><span id="local-6989586621679702488"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] ForeignLib
</span><a href="#local-6989586621679702488"><span class="hs-identifier hs-var">flib</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult (CondTree ConfVar [Dependency] ForeignLib)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] ForeignLib)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult (CondTree ConfVar [Dependency] ForeignLib)
 -&gt; StateT
      SectionS ParseResult (CondTree ConfVar [Dependency] ForeignLib))
-&gt; ParseResult (CondTree ConfVar [Dependency] ForeignLib)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] ForeignLib)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' ForeignLib
-&gt; (BuildInfo -&gt; ForeignLib)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] ForeignLib)
forall a.
HasBuildInfo a =&gt;
ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702528"><span class="hs-identifier hs-var">parseCondTree'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; ParsecFieldGrammar' ForeignLib
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g ForeignLib),
 Applicative (g BuildInfo), c (Identity ForeignLibType),
 c (Identity LibVersionInfo), c (Identity Version),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List FSep (Identity ForeignLibOption) ForeignLibOption),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
UnqualComponentName -&gt; g ForeignLib ForeignLib
</span><a href="Distribution.PackageDescription.FieldGrammar.html#foreignLibFieldGrammar"><span class="hs-identifier hs-var">foreignLibFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702489"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; BuildInfo -&gt; ForeignLib
forall a. FromBuildInfo a =&gt; UnqualComponentName -&gt; BuildInfo -&gt; a
</span><a href="Distribution.PackageDescription.Parsec.html#fromBuildInfo%27"><span class="hs-identifier hs-var">fromBuildInfo'</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702489"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702490"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-300"></span><span>
</span><span id="line-301"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702482"><span class="annot"><span class="annottext">hasType :: ForeignLib -&gt; Bool
</span><a href="#local-6989586621679702482"><span class="hs-identifier hs-var hs-var">hasType</span></a></span></span><span> </span><span id="local-6989586621679702481"><span class="annot"><span class="annottext">ForeignLib
</span><a href="#local-6989586621679702481"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignLib -&gt; ForeignLibType
</span><a href="Distribution.Types.ForeignLib.html#foreignLibType"><span class="hs-identifier hs-var hs-var">foreignLibType</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLib
</span><a href="#local-6989586621679702481"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLibType -&gt; ForeignLibType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ForeignLib -&gt; ForeignLibType
</span><a href="Distribution.Types.ForeignLib.html#foreignLibType"><span class="hs-identifier hs-var hs-var">foreignLibType</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLib
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-302"></span><span>            </span><span class="annot"><span class="annottext">Bool
-&gt; StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ForeignLib -&gt; Bool)
-&gt; CondTree ConfVar [Dependency] ForeignLib -&gt; Bool
forall v c a. Monoid a =&gt; (a -&gt; Bool) -&gt; CondTree v c a -&gt; Bool
</span><a href="Distribution.PackageDescription.Parsec.html#onAllBranches"><span class="hs-identifier hs-var">onAllBranches</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLib -&gt; Bool
</span><a href="#local-6989586621679702482"><span class="hs-identifier hs-var">hasType</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] ForeignLib
</span><a href="#local-6989586621679702488"><span class="hs-identifier hs-var">flib</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span>
</span><span id="line-303"></span><span>                </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Foreign library &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702489"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-304"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; is missing required field \&quot;type\&quot; or the field &quot;</span></span><span>
</span><span id="line-305"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not present in all conditional branches. The &quot;</span></span><span>
</span><span id="line-306"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;available test types are: &quot;</span></span><span>
</span><span id="line-307"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; String
forall a. [a] -&gt; [[a]] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;, &quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ForeignLibType -&gt; String) -&gt; [ForeignLibType] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLibType -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignLibType]
</span><a href="Distribution.Types.ForeignLibType.html#knownForeignLibTypes"><span class="hs-identifier hs-var">knownForeignLibTypes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>                </span><span class="hs-special">]</span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span>            </span><span class="hs-comment">-- TODO check duplicate name here?</span><span>
</span><span id="line-311"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; (([(UnqualComponentName,
       CondTree ConfVar [Dependency] ForeignLib)]
     -&gt; Identity
          [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)])
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; ([(UnqualComponentName,
      CondTree ConfVar [Dependency] ForeignLib)]
    -&gt; Identity
         [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)])
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
 -&gt; Identity
      [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)])
-&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription
Lens'
  GenericPackageDescription
  [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#condForeignLibs"><span class="hs-identifier hs-var">L.condForeignLibs</span></a></span><span> </span><span class="annot"><span class="annottext">(([(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
  -&gt; Identity
       [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)])
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; ([(UnqualComponentName,
      CondTree ConfVar [Dependency] ForeignLib)]
    -&gt; [(UnqualComponentName,
         CondTree ConfVar [Dependency] ForeignLib)])
-&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%25%3D"><span class="hs-operator hs-var">%=</span></a></span><span> </span><span class="annot"><span class="annottext">(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
-&gt; [(UnqualComponentName,
     CondTree ConfVar [Dependency] ForeignLib)]
-&gt; [(UnqualComponentName,
     CondTree ConfVar [Dependency] ForeignLib)]
forall {a}. a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679702533"><span class="hs-identifier hs-var">snoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702489"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] ForeignLib
</span><a href="#local-6989586621679702488"><span class="hs-identifier hs-var">flib</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;executable&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-314"></span><span>            </span><span id="local-6989586621679702473"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702473"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
-&gt; StateT SectionS ParseResult (Map String CondTreeBuildInfo)
forall s (m :: * -&gt; *) a. MonadState s m =&gt; Getting a s a -&gt; m a
</span><a href="Distribution.Compat.Lens.html#use"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var">stateCommonStanzas</span></a></span><span>
</span><span id="line-315"></span><span>            </span><span id="local-6989586621679702472"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702472"><span class="hs-identifier hs-var">name'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Position
-&gt; [SectionArg Position] -&gt; SectionParser UnqualComponentName
</span><a href="Distribution.PackageDescription.Parsec.html#parseUnqualComponentName"><span class="hs-identifier hs-var">parseUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-316"></span><span>            </span><span id="local-6989586621679702471"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Executable
</span><a href="#local-6989586621679702471"><span class="hs-identifier hs-var">exe</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult (CondTree ConfVar [Dependency] Executable)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] Executable)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult (CondTree ConfVar [Dependency] Executable)
 -&gt; StateT
      SectionS ParseResult (CondTree ConfVar [Dependency] Executable))
-&gt; ParseResult (CondTree ConfVar [Dependency] Executable)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] Executable)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' Executable
-&gt; (BuildInfo -&gt; Executable)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] Executable)
forall a.
HasBuildInfo a =&gt;
ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702528"><span class="hs-identifier hs-var">parseCondTree'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; ParsecFieldGrammar' Executable
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g Executable),
 Applicative (g BuildInfo), c (Identity ExecutableScope),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
UnqualComponentName -&gt; g Executable Executable
</span><a href="Distribution.PackageDescription.FieldGrammar.html#executableFieldGrammar"><span class="hs-identifier hs-var">executableFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702472"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; BuildInfo -&gt; Executable
forall a. FromBuildInfo a =&gt; UnqualComponentName -&gt; BuildInfo -&gt; a
</span><a href="Distribution.PackageDescription.Parsec.html#fromBuildInfo%27"><span class="hs-identifier hs-var">fromBuildInfo'</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702472"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702473"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-317"></span><span>            </span><span class="hs-comment">-- TODO check duplicate name here?</span><span>
</span><span id="line-318"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; (([(UnqualComponentName,
       CondTree ConfVar [Dependency] Executable)]
     -&gt; Identity
          [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)])
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; ([(UnqualComponentName,
      CondTree ConfVar [Dependency] Executable)]
    -&gt; Identity
         [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)])
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
 -&gt; Identity
      [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)])
-&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription
Lens'
  GenericPackageDescription
  [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#condExecutables"><span class="hs-identifier hs-var">L.condExecutables</span></a></span><span> </span><span class="annot"><span class="annottext">(([(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
  -&gt; Identity
       [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)])
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; ([(UnqualComponentName,
      CondTree ConfVar [Dependency] Executable)]
    -&gt; [(UnqualComponentName,
         CondTree ConfVar [Dependency] Executable)])
-&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%25%3D"><span class="hs-operator hs-var">%=</span></a></span><span> </span><span class="annot"><span class="annottext">(UnqualComponentName, CondTree ConfVar [Dependency] Executable)
-&gt; [(UnqualComponentName,
     CondTree ConfVar [Dependency] Executable)]
-&gt; [(UnqualComponentName,
     CondTree ConfVar [Dependency] Executable)]
forall {a}. a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679702533"><span class="hs-identifier hs-var">snoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702472"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Executable
</span><a href="#local-6989586621679702471"><span class="hs-identifier hs-var">exe</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;test-suite&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-321"></span><span>            </span><span id="local-6989586621679702468"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702468"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
-&gt; StateT SectionS ParseResult (Map String CondTreeBuildInfo)
forall s (m :: * -&gt; *) a. MonadState s m =&gt; Getting a s a -&gt; m a
</span><a href="Distribution.Compat.Lens.html#use"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var">stateCommonStanzas</span></a></span><span>
</span><span id="line-322"></span><span>            </span><span id="local-6989586621679702467"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702467"><span class="hs-identifier hs-var">name'</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Position
-&gt; [SectionArg Position] -&gt; SectionParser UnqualComponentName
</span><a href="Distribution.PackageDescription.Parsec.html#parseUnqualComponentName"><span class="hs-identifier hs-var">parseUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-323"></span><span>            </span><span id="local-6989586621679702466"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] TestSuiteStanza
</span><a href="#local-6989586621679702466"><span class="hs-identifier hs-var">testStanza</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult (CondTree ConfVar [Dependency] TestSuiteStanza)
-&gt; StateT
     SectionS
     ParseResult
     (CondTree ConfVar [Dependency] TestSuiteStanza)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult (CondTree ConfVar [Dependency] TestSuiteStanza)
 -&gt; StateT
      SectionS
      ParseResult
      (CondTree ConfVar [Dependency] TestSuiteStanza))
-&gt; ParseResult (CondTree ConfVar [Dependency] TestSuiteStanza)
-&gt; StateT
     SectionS
     ParseResult
     (CondTree ConfVar [Dependency] TestSuiteStanza)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' TestSuiteStanza
-&gt; (BuildInfo -&gt; TestSuiteStanza)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] TestSuiteStanza)
forall a.
HasBuildInfo a =&gt;
ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702528"><span class="hs-identifier hs-var">parseCondTree'</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' TestSuiteStanza
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g TestSuiteStanza),
 Applicative (g BuildInfo), c (Identity ModuleName),
 c (Identity TestType),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
g TestSuiteStanza TestSuiteStanza
</span><a href="Distribution.PackageDescription.FieldGrammar.html#testSuiteFieldGrammar"><span class="hs-identifier hs-var">testSuiteFieldGrammar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; BuildInfo -&gt; TestSuiteStanza
forall a. FromBuildInfo a =&gt; UnqualComponentName -&gt; BuildInfo -&gt; a
</span><a href="Distribution.PackageDescription.Parsec.html#fromBuildInfo%27"><span class="hs-identifier hs-var">fromBuildInfo'</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702467"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702468"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-324"></span><span>            </span><span id="local-6989586621679702464"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] TestSuite
</span><a href="#local-6989586621679702464"><span class="hs-identifier hs-var">testSuite</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult (CondTree ConfVar [Dependency] TestSuite)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] TestSuite)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult (CondTree ConfVar [Dependency] TestSuite)
 -&gt; StateT
      SectionS ParseResult (CondTree ConfVar [Dependency] TestSuite))
-&gt; ParseResult (CondTree ConfVar [Dependency] TestSuite)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] TestSuite)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(TestSuiteStanza -&gt; ParseResult TestSuite)
-&gt; CondTree ConfVar [Dependency] TestSuiteStanza
-&gt; ParseResult (CondTree ConfVar [Dependency] TestSuite)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Position -&gt; TestSuiteStanza -&gt; ParseResult TestSuite
</span><a href="Distribution.PackageDescription.FieldGrammar.html#validateTestSuite"><span class="hs-identifier hs-var">validateTestSuite</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] TestSuiteStanza
</span><a href="#local-6989586621679702466"><span class="hs-identifier hs-var">testStanza</span></a></span><span>
</span><span id="line-325"></span><span>
</span><span id="line-326"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702458"><span class="annot"><span class="annottext">hasType :: TestSuite -&gt; Bool
</span><a href="#local-6989586621679702458"><span class="hs-identifier hs-var hs-var">hasType</span></a></span></span><span> </span><span id="local-6989586621679702457"><span class="annot"><span class="annottext">TestSuite
</span><a href="#local-6989586621679702457"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TestSuite -&gt; TestSuiteInterface
</span><a href="Distribution.Types.TestSuite.html#testInterface"><span class="hs-identifier hs-var hs-var">testInterface</span></a></span><span> </span><span class="annot"><span class="annottext">TestSuite
</span><a href="#local-6989586621679702457"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">TestSuiteInterface -&gt; TestSuiteInterface -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">TestSuite -&gt; TestSuiteInterface
</span><a href="Distribution.Types.TestSuite.html#testInterface"><span class="hs-identifier hs-var hs-var">testInterface</span></a></span><span> </span><span class="annot"><span class="annottext">TestSuite
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-327"></span><span>            </span><span class="annot"><span class="annottext">Bool
-&gt; StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TestSuite -&gt; Bool)
-&gt; CondTree ConfVar [Dependency] TestSuite -&gt; Bool
forall v c a. Monoid a =&gt; (a -&gt; Bool) -&gt; CondTree v c a -&gt; Bool
</span><a href="Distribution.PackageDescription.Parsec.html#onAllBranches"><span class="hs-identifier hs-var">onAllBranches</span></a></span><span> </span><span class="annot"><span class="annottext">TestSuite -&gt; Bool
</span><a href="#local-6989586621679702458"><span class="hs-identifier hs-var">hasType</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] TestSuite
</span><a href="#local-6989586621679702464"><span class="hs-identifier hs-var">testSuite</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span>
</span><span id="line-328"></span><span>                </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Test suite &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702467"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; is missing required field \&quot;type\&quot; or the field &quot;</span></span><span>
</span><span id="line-330"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not present in all conditional branches. The &quot;</span></span><span>
</span><span id="line-331"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;available test types are: &quot;</span></span><span>
</span><span id="line-332"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; String
forall a. [a] -&gt; [[a]] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;, &quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TestType -&gt; String) -&gt; [TestType] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TestType -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">[TestType]
</span><a href="Distribution.Types.TestType.html#knownTestTypes"><span class="hs-identifier hs-var">knownTestTypes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span>                </span><span class="hs-special">]</span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span>            </span><span class="hs-comment">-- TODO check duplicate name here?</span><span>
</span><span id="line-336"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; (([(UnqualComponentName,
       CondTree ConfVar [Dependency] TestSuite)]
     -&gt; Identity
          [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)])
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; ([(UnqualComponentName,
      CondTree ConfVar [Dependency] TestSuite)]
    -&gt; Identity
         [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)])
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
 -&gt; Identity
      [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)])
-&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription
Lens'
  GenericPackageDescription
  [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#condTestSuites"><span class="hs-identifier hs-var">L.condTestSuites</span></a></span><span> </span><span class="annot"><span class="annottext">(([(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
  -&gt; Identity
       [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)])
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; ([(UnqualComponentName,
      CondTree ConfVar [Dependency] TestSuite)]
    -&gt; [(UnqualComponentName,
         CondTree ConfVar [Dependency] TestSuite)])
-&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%25%3D"><span class="hs-operator hs-var">%=</span></a></span><span> </span><span class="annot"><span class="annottext">(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
-&gt; [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-&gt; [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
forall {a}. a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679702533"><span class="hs-identifier hs-var">snoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702467"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] TestSuite
</span><a href="#local-6989586621679702464"><span class="hs-identifier hs-var">testSuite</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;benchmark&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-339"></span><span>            </span><span id="local-6989586621679702453"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702453"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
-&gt; StateT SectionS ParseResult (Map String CondTreeBuildInfo)
forall s (m :: * -&gt; *) a. MonadState s m =&gt; Getting a s a -&gt; m a
</span><a href="Distribution.Compat.Lens.html#use"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">Getting
  (Map String CondTreeBuildInfo)
  SectionS
  (Map String CondTreeBuildInfo)
Lens' SectionS (Map String CondTreeBuildInfo)
</span><a href="Distribution.PackageDescription.Parsec.html#stateCommonStanzas"><span class="hs-identifier hs-var">stateCommonStanzas</span></a></span><span>
</span><span id="line-340"></span><span>            </span><span id="local-6989586621679702452"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702452"><span class="hs-identifier hs-var">name'</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Position
-&gt; [SectionArg Position] -&gt; SectionParser UnqualComponentName
</span><a href="Distribution.PackageDescription.Parsec.html#parseUnqualComponentName"><span class="hs-identifier hs-var">parseUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-341"></span><span>            </span><span id="local-6989586621679702451"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] BenchmarkStanza
</span><a href="#local-6989586621679702451"><span class="hs-identifier hs-var">benchStanza</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult (CondTree ConfVar [Dependency] BenchmarkStanza)
-&gt; StateT
     SectionS
     ParseResult
     (CondTree ConfVar [Dependency] BenchmarkStanza)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult (CondTree ConfVar [Dependency] BenchmarkStanza)
 -&gt; StateT
      SectionS
      ParseResult
      (CondTree ConfVar [Dependency] BenchmarkStanza))
-&gt; ParseResult (CondTree ConfVar [Dependency] BenchmarkStanza)
-&gt; StateT
     SectionS
     ParseResult
     (CondTree ConfVar [Dependency] BenchmarkStanza)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' BenchmarkStanza
-&gt; (BuildInfo -&gt; BenchmarkStanza)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] BenchmarkStanza)
forall a.
HasBuildInfo a =&gt;
ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702528"><span class="hs-identifier hs-var">parseCondTree'</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' BenchmarkStanza
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g BenchmarkStanza),
 Applicative (g BuildInfo), c (Identity BenchmarkType),
 c (Identity ModuleName),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
g BenchmarkStanza BenchmarkStanza
</span><a href="Distribution.PackageDescription.FieldGrammar.html#benchmarkFieldGrammar"><span class="hs-identifier hs-var">benchmarkFieldGrammar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; BuildInfo -&gt; BenchmarkStanza
forall a. FromBuildInfo a =&gt; UnqualComponentName -&gt; BuildInfo -&gt; a
</span><a href="Distribution.PackageDescription.Parsec.html#fromBuildInfo%27"><span class="hs-identifier hs-var">fromBuildInfo'</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702452"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702453"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-342"></span><span>            </span><span id="local-6989586621679702449"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Benchmark
</span><a href="#local-6989586621679702449"><span class="hs-identifier hs-var">bench</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult (CondTree ConfVar [Dependency] Benchmark)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] Benchmark)
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult (CondTree ConfVar [Dependency] Benchmark)
 -&gt; StateT
      SectionS ParseResult (CondTree ConfVar [Dependency] Benchmark))
-&gt; ParseResult (CondTree ConfVar [Dependency] Benchmark)
-&gt; StateT
     SectionS ParseResult (CondTree ConfVar [Dependency] Benchmark)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(BenchmarkStanza -&gt; ParseResult Benchmark)
-&gt; CondTree ConfVar [Dependency] BenchmarkStanza
-&gt; ParseResult (CondTree ConfVar [Dependency] Benchmark)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Position -&gt; BenchmarkStanza -&gt; ParseResult Benchmark
</span><a href="Distribution.PackageDescription.FieldGrammar.html#validateBenchmark"><span class="hs-identifier hs-var">validateBenchmark</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] BenchmarkStanza
</span><a href="#local-6989586621679702451"><span class="hs-identifier hs-var">benchStanza</span></a></span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702444"><span class="annot"><span class="annottext">hasType :: Benchmark -&gt; Bool
</span><a href="#local-6989586621679702444"><span class="hs-identifier hs-var hs-var">hasType</span></a></span></span><span> </span><span id="local-6989586621679702443"><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679702443"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; BenchmarkInterface
</span><a href="Distribution.Types.Benchmark.html#benchmarkInterface"><span class="hs-identifier hs-var hs-var">benchmarkInterface</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
</span><a href="#local-6989586621679702443"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">BenchmarkInterface -&gt; BenchmarkInterface -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; BenchmarkInterface
</span><a href="Distribution.Types.Benchmark.html#benchmarkInterface"><span class="hs-identifier hs-var hs-var">benchmarkInterface</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-345"></span><span>            </span><span class="annot"><span class="annottext">Bool
-&gt; StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Benchmark -&gt; Bool)
-&gt; CondTree ConfVar [Dependency] Benchmark -&gt; Bool
forall v c a. Monoid a =&gt; (a -&gt; Bool) -&gt; CondTree v c a -&gt; Bool
</span><a href="Distribution.PackageDescription.Parsec.html#onAllBranches"><span class="hs-identifier hs-var">onAllBranches</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark -&gt; Bool
</span><a href="#local-6989586621679702444"><span class="hs-identifier hs-var">hasType</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Benchmark
</span><a href="#local-6989586621679702449"><span class="hs-identifier hs-var">bench</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; StateT SectionS ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span>
</span><span id="line-346"></span><span>                </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Benchmark &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702452"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; is missing required field \&quot;type\&quot; or the field &quot;</span></span><span>
</span><span id="line-348"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not present in all conditional branches. The &quot;</span></span><span>
</span><span id="line-349"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;available benchmark types are: &quot;</span></span><span>
</span><span id="line-350"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; String
forall a. [a] -&gt; [[a]] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;, &quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(BenchmarkType -&gt; String) -&gt; [BenchmarkType] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">BenchmarkType -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">[BenchmarkType]
</span><a href="Distribution.Types.BenchmarkType.html#knownBenchmarkTypes"><span class="hs-identifier hs-var">knownBenchmarkTypes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span>                </span><span class="hs-special">]</span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span>            </span><span class="hs-comment">-- TODO check duplicate name here?</span><span>
</span><span id="line-354"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; (([(UnqualComponentName,
       CondTree ConfVar [Dependency] Benchmark)]
     -&gt; Identity
          [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)])
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; ([(UnqualComponentName,
      CondTree ConfVar [Dependency] Benchmark)]
    -&gt; Identity
         [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)])
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
 -&gt; Identity
      [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)])
-&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription
Lens'
  GenericPackageDescription
  [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#condBenchmarks"><span class="hs-identifier hs-var">L.condBenchmarks</span></a></span><span> </span><span class="annot"><span class="annottext">(([(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
  -&gt; Identity
       [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)])
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; ([(UnqualComponentName,
      CondTree ConfVar [Dependency] Benchmark)]
    -&gt; [(UnqualComponentName,
         CondTree ConfVar [Dependency] Benchmark)])
-&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%25%3D"><span class="hs-operator hs-var">%=</span></a></span><span> </span><span class="annot"><span class="annottext">(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
-&gt; [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-&gt; [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
forall {a}. a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679702533"><span class="hs-identifier hs-var">snoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702452"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Benchmark
</span><a href="#local-6989586621679702449"><span class="hs-identifier hs-var">bench</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>
</span><span id="line-356"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;flag&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-357"></span><span>            </span><span id="local-6989586621679702439"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702439"><span class="hs-identifier hs-var">name'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Position -&gt; [SectionArg Position] -&gt; SectionParser ByteString
</span><a href="Distribution.PackageDescription.Parsec.html#parseNameBS"><span class="hs-identifier hs-var">parseNameBS</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-358"></span><span>            </span><span id="local-6989586621679702437"><span class="annot"><span class="annottext">FlagName
</span><a href="#local-6989586621679702437"><span class="hs-identifier hs-var">name''</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult FlagName -&gt; StateT SectionS ParseResult FlagName
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult FlagName -&gt; StateT SectionS ParseResult FlagName)
-&gt; ParseResult FlagName -&gt; StateT SectionS ParseResult FlagName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Position]
-&gt; ParsecParser FlagName
-&gt; CabalSpecVersion
-&gt; FieldLineStream
-&gt; ParseResult FlagName
forall a.
[Position]
-&gt; ParsecParser a
-&gt; CabalSpecVersion
-&gt; FieldLineStream
-&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#runFieldParser%27"><span class="hs-identifier hs-var">runFieldParser'</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ParsecParser FlagName
forall a (m :: * -&gt; *). (Parsec a, CabalParsing m) =&gt; m a
</span><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier hs-var">parsec</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702551"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromBS"><span class="hs-identifier hs-var">fieldLineStreamFromBS</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702439"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseResult FlagName -&gt; FlagName -&gt; ParseResult FlagName
forall a. ParseResult a -&gt; a -&gt; ParseResult a
</span><a href="Distribution.Fields.ParseResult.html#recoverWith"><span class="hs-operator hs-var">`recoverWith`</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; FlagName
</span><a href="Distribution.Types.Flag.html#mkFlagName"><span class="hs-identifier hs-var">mkFlagName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-359"></span><span>            </span><span id="local-6989586621679702433"><span class="annot"><span class="annottext">PackageFlag
</span><a href="#local-6989586621679702433"><span class="hs-identifier hs-var">flag</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult PackageFlag -&gt; StateT SectionS ParseResult PackageFlag
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult PackageFlag
 -&gt; StateT SectionS ParseResult PackageFlag)
-&gt; ParseResult PackageFlag
-&gt; StateT SectionS ParseResult PackageFlag
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; [Field Position]
-&gt; ParsecFieldGrammar' PackageFlag
-&gt; ParseResult PackageFlag
forall a.
CabalSpecVersion
-&gt; [Field Position] -&gt; ParsecFieldGrammar' a -&gt; ParseResult a
</span><a href="Distribution.PackageDescription.Parsec.html#parseFields"><span class="hs-identifier hs-var">parseFields</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702551"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FlagName -&gt; ParsecFieldGrammar' PackageFlag
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g PackageFlag)) =&gt;
FlagName -&gt; g PackageFlag PackageFlag
</span><a href="Distribution.PackageDescription.FieldGrammar.html#flagFieldGrammar"><span class="hs-identifier hs-var">flagFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">FlagName
</span><a href="#local-6989586621679702437"><span class="hs-identifier hs-var">name''</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-360"></span><span>            </span><span class="hs-comment">-- Check default flag</span><span>
</span><span id="line-361"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; (([PackageFlag] -&gt; Identity [PackageFlag])
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; ([PackageFlag] -&gt; Identity [PackageFlag])
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([PackageFlag] -&gt; Identity [PackageFlag])
-&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription
Lens' GenericPackageDescription [PackageFlag]
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#genPackageFlags"><span class="hs-identifier hs-var">L.genPackageFlags</span></a></span><span> </span><span class="annot"><span class="annottext">(([PackageFlag] -&gt; Identity [PackageFlag])
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; ([PackageFlag] -&gt; [PackageFlag])
-&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%25%3D"><span class="hs-operator hs-var">%=</span></a></span><span> </span><span class="annot"><span class="annottext">PackageFlag -&gt; [PackageFlag] -&gt; [PackageFlag]
forall {a}. a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679702533"><span class="hs-identifier hs-var">snoc</span></a></span><span> </span><span class="annot"><span class="annottext">PackageFlag
</span><a href="#local-6989586621679702433"><span class="hs-identifier hs-var">flag</span></a></span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;custom-setup&quot;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-364"></span><span>            </span><span id="local-6989586621679702429"><span class="annot"><span class="annottext">SetupBuildInfo
</span><a href="#local-6989586621679702429"><span class="hs-identifier hs-var">sbi</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult SetupBuildInfo
-&gt; StateT SectionS ParseResult SetupBuildInfo
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult SetupBuildInfo
 -&gt; StateT SectionS ParseResult SetupBuildInfo)
-&gt; ParseResult SetupBuildInfo
-&gt; StateT SectionS ParseResult SetupBuildInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; [Field Position]
-&gt; ParsecFieldGrammar' SetupBuildInfo
-&gt; ParseResult SetupBuildInfo
forall a.
CabalSpecVersion
-&gt; [Field Position] -&gt; ParsecFieldGrammar' a -&gt; ParseResult a
</span><a href="Distribution.PackageDescription.Parsec.html#parseFields"><span class="hs-identifier hs-var">parseFields</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702551"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; ParsecFieldGrammar' SetupBuildInfo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Functor (g SetupBuildInfo),
 c (List CommaVCat (Identity Dependency) Dependency)) =&gt;
Bool -&gt; g SetupBuildInfo SetupBuildInfo
</span><a href="Distribution.PackageDescription.FieldGrammar.html#setupBInfoFieldGrammar"><span class="hs-identifier hs-var">setupBInfoFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; ((Maybe SetupBuildInfo -&gt; Identity (Maybe SetupBuildInfo))
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; (Maybe SetupBuildInfo -&gt; Identity (Maybe SetupBuildInfo))
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  GenericPackageDescription
  GenericPackageDescription
  PackageDescription
  PackageDescription
Lens' GenericPackageDescription PackageDescription
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#packageDescription"><span class="hs-identifier hs-var">L.packageDescription</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  GenericPackageDescription
  GenericPackageDescription
  PackageDescription
  PackageDescription
-&gt; ((Maybe SetupBuildInfo -&gt; Identity (Maybe SetupBuildInfo))
    -&gt; PackageDescription -&gt; Identity PackageDescription)
-&gt; (Maybe SetupBuildInfo -&gt; Identity (Maybe SetupBuildInfo))
-&gt; GenericPackageDescription
-&gt; Identity GenericPackageDescription
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe SetupBuildInfo -&gt; Identity (Maybe SetupBuildInfo))
-&gt; PackageDescription -&gt; Identity PackageDescription
Lens' PackageDescription (Maybe SetupBuildInfo)
</span><a href="Distribution.Types.PackageDescription.Lens.html#setupBuildInfo"><span class="hs-identifier hs-var">L.setupBuildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">((Maybe SetupBuildInfo -&gt; Identity (Maybe SetupBuildInfo))
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; SetupBuildInfo -&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a (Maybe b) -&gt; b -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%3F%3D"><span class="hs-operator hs-var">?=</span></a></span><span> </span><span class="annot"><span class="annottext">SetupBuildInfo
</span><a href="#local-6989586621679702429"><span class="hs-identifier hs-var">sbi</span></a></span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;source-repository&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-368"></span><span>            </span><span id="local-6989586621679702426"><span class="annot"><span class="annottext">RepoKind
</span><a href="#local-6989586621679702426"><span class="hs-identifier hs-var">kind</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult RepoKind -&gt; StateT SectionS ParseResult RepoKind
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult RepoKind -&gt; StateT SectionS ParseResult RepoKind)
-&gt; ParseResult RepoKind -&gt; StateT SectionS ParseResult RepoKind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-369"></span><span>                </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SecArgName"><span class="hs-identifier hs-type">SecArgName</span></a></span><span> </span><span id="local-6989586621679702424"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702424"><span class="hs-identifier hs-var">spos</span></a></span></span><span> </span><span id="local-6989586621679702423"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702423"><span class="hs-identifier hs-var">secName</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-370"></span><span>                    </span><span class="annot"><span class="annottext">[Position]
-&gt; ParsecParser RepoKind
-&gt; CabalSpecVersion
-&gt; FieldLineStream
-&gt; ParseResult RepoKind
forall a.
[Position]
-&gt; ParsecParser a
-&gt; CabalSpecVersion
-&gt; FieldLineStream
-&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#runFieldParser%27"><span class="hs-identifier hs-var">runFieldParser'</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702424"><span class="hs-identifier hs-var">spos</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ParsecParser RepoKind
forall a (m :: * -&gt; *). (Parsec a, CabalParsing m) =&gt; m a
</span><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier hs-var">parsec</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702551"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromBS"><span class="hs-identifier hs-var">fieldLineStreamFromBS</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702423"><span class="hs-identifier hs-var">secName</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ParseResult RepoKind -&gt; RepoKind -&gt; ParseResult RepoKind
forall a. ParseResult a -&gt; a -&gt; ParseResult a
</span><a href="Distribution.Fields.ParseResult.html#recoverWith"><span class="hs-operator hs-var">`recoverWith`</span></a></span><span> </span><span class="annot"><span class="annottext">RepoKind
</span><a href="Distribution.Types.SourceRepo.html#RepoHead"><span class="hs-identifier hs-var">RepoHead</span></a></span><span>
</span><span id="line-371"></span><span>                </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-372"></span><span>                    </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'source-repository' requires exactly one argument&quot;</span></span><span>
</span><span id="line-373"></span><span>                    </span><span class="annot"><span class="annottext">RepoKind -&gt; ParseResult RepoKind
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">RepoKind
</span><a href="Distribution.Types.SourceRepo.html#RepoHead"><span class="hs-identifier hs-var">RepoHead</span></a></span><span>
</span><span id="line-374"></span><span>                </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-375"></span><span>                    </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Invalid source-repository kind &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702522"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-376"></span><span>                    </span><span class="annot"><span class="annottext">RepoKind -&gt; ParseResult RepoKind
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">RepoKind
</span><a href="Distribution.Types.SourceRepo.html#RepoHead"><span class="hs-identifier hs-var">RepoHead</span></a></span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span>            </span><span id="local-6989586621679702421"><span class="annot"><span class="annottext">SourceRepo
</span><a href="#local-6989586621679702421"><span class="hs-identifier hs-var">sr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParseResult SourceRepo -&gt; StateT SectionS ParseResult SourceRepo
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult SourceRepo -&gt; StateT SectionS ParseResult SourceRepo)
-&gt; ParseResult SourceRepo -&gt; StateT SectionS ParseResult SourceRepo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; [Field Position]
-&gt; ParsecFieldGrammar' SourceRepo
-&gt; ParseResult SourceRepo
forall a.
CabalSpecVersion
-&gt; [Field Position] -&gt; ParsecFieldGrammar' a -&gt; ParseResult a
</span><a href="Distribution.PackageDescription.Parsec.html#parseFields"><span class="hs-identifier hs-var">parseFields</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702551"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702521"><span class="hs-identifier hs-var">fields</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RepoKind -&gt; ParsecFieldGrammar' SourceRepo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g SourceRepo),
 c (Identity RepoType), c Token, c FilePathNT) =&gt;
RepoKind -&gt; g SourceRepo SourceRepo
</span><a href="Distribution.PackageDescription.FieldGrammar.html#sourceRepoFieldGrammar"><span class="hs-identifier hs-var">sourceRepoFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">RepoKind
</span><a href="#local-6989586621679702426"><span class="hs-identifier hs-var">kind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span>            </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
Lens' SectionS GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#stateGpd"><span class="hs-identifier hs-var">stateGpd</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  SectionS
  SectionS
  GenericPackageDescription
  GenericPackageDescription
-&gt; (([SourceRepo] -&gt; Identity [SourceRepo])
    -&gt; GenericPackageDescription -&gt; Identity GenericPackageDescription)
-&gt; ([SourceRepo] -&gt; Identity [SourceRepo])
-&gt; SectionS
-&gt; Identity SectionS
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  GenericPackageDescription
  GenericPackageDescription
  PackageDescription
  PackageDescription
Lens' GenericPackageDescription PackageDescription
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#packageDescription"><span class="hs-identifier hs-var">L.packageDescription</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  Identity
  GenericPackageDescription
  GenericPackageDescription
  PackageDescription
  PackageDescription
-&gt; (([SourceRepo] -&gt; Identity [SourceRepo])
    -&gt; PackageDescription -&gt; Identity PackageDescription)
-&gt; ([SourceRepo] -&gt; Identity [SourceRepo])
-&gt; GenericPackageDescription
-&gt; Identity GenericPackageDescription
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([SourceRepo] -&gt; Identity [SourceRepo])
-&gt; PackageDescription -&gt; Identity PackageDescription
Lens' PackageDescription [SourceRepo]
</span><a href="Distribution.Types.PackageDescription.Lens.html#sourceRepos"><span class="hs-identifier hs-var">L.sourceRepos</span></a></span><span> </span><span class="annot"><span class="annottext">(([SourceRepo] -&gt; Identity [SourceRepo])
 -&gt; SectionS -&gt; Identity SectionS)
-&gt; ([SourceRepo] -&gt; [SourceRepo]) -&gt; StateT SectionS ParseResult ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
ASetter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><a href="Distribution.Compat.Lens.html#%25%3D"><span class="hs-operator hs-var">%=</span></a></span><span> </span><span class="annot"><span class="annottext">SourceRepo -&gt; [SourceRepo] -&gt; [SourceRepo]
forall {a}. a -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679702533"><span class="hs-identifier hs-var">snoc</span></a></span><span> </span><span class="annot"><span class="annottext">SourceRepo
</span><a href="#local-6989586621679702421"><span class="hs-identifier hs-var">sr</span></a></span><span>
</span><span id="line-380"></span><span>
</span><span id="line-381"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-382"></span><span>            </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702524"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTUnknownSection"><span class="hs-identifier hs-var">PWTUnknownSection</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ignoring section: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702523"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseName"><span class="hs-identifier hs-type">parseName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SectionArg"><span class="hs-identifier hs-type">SectionArg</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionParser"><span class="hs-identifier hs-type">SectionParser</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-385"></span><span id="parseName"><span class="annot"><span class="annottext">parseName :: Position
-&gt; [SectionArg Position] -&gt; StateT SectionS ParseResult String
</span><a href="Distribution.PackageDescription.Parsec.html#parseName"><span class="hs-identifier hs-var hs-var">parseName</span></a></span></span><span> </span><span id="local-6989586621679702417"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702417"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702416"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702416"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String
</span><a href="Distribution.Utils.Generic.html#fromUTF8BS"><span class="hs-identifier hs-var">fromUTF8BS</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; String)
-&gt; SectionParser ByteString -&gt; StateT SectionS ParseResult String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; [SectionArg Position] -&gt; SectionParser ByteString
</span><a href="Distribution.PackageDescription.Parsec.html#parseNameBS"><span class="hs-identifier hs-var">parseNameBS</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702417"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702416"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-386"></span><span>
</span><span id="line-387"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseNameBS"><span class="hs-identifier hs-type">parseNameBS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SectionArg"><span class="hs-identifier hs-type">SectionArg</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionParser"><span class="hs-identifier hs-type">SectionParser</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span>
</span><span id="line-388"></span><span class="hs-comment">-- TODO: use strict parser</span><span>
</span><span id="line-389"></span><span id="parseNameBS"><span class="annot"><span class="annottext">parseNameBS :: Position -&gt; [SectionArg Position] -&gt; SectionParser ByteString
</span><a href="Distribution.PackageDescription.Parsec.html#parseNameBS"><span class="hs-identifier hs-var hs-var">parseNameBS</span></a></span></span><span> </span><span id="local-6989586621679702415"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702415"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702414"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702414"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702414"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-390"></span><span>    </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SecArgName"><span class="hs-identifier hs-type">SecArgName</span></a></span><span> </span><span id="local-6989586621679702413"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702413"><span class="hs-identifier hs-var">_pos</span></a></span></span><span> </span><span id="local-6989586621679702412"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702412"><span class="hs-identifier hs-var">secName</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-391"></span><span>         </span><span class="annot"><span class="annottext">ByteString -&gt; SectionParser ByteString
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702412"><span class="hs-identifier hs-var">secName</span></a></span><span>
</span><span id="line-392"></span><span>    </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SecArgStr"><span class="hs-identifier hs-type">SecArgStr</span></a></span><span> </span><span id="local-6989586621679702410"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702410"><span class="hs-identifier hs-var">_pos</span></a></span></span><span> </span><span id="local-6989586621679702409"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702409"><span class="hs-identifier hs-var">secName</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-393"></span><span>         </span><span class="annot"><span class="annottext">ByteString -&gt; SectionParser ByteString
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702409"><span class="hs-identifier hs-var">secName</span></a></span><span>
</span><span id="line-394"></span><span>    </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-395"></span><span>         </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702415"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;name required&quot;</span></span><span>
</span><span id="line-396"></span><span>         </span><span class="annot"><span class="annottext">ByteString -&gt; SectionParser ByteString
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-397"></span><span>    </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-398"></span><span>         </span><span class="hs-comment">-- TODO: pretty print args</span><span>
</span><span id="line-399"></span><span>         </span><span class="annot"><span class="annottext">ParseResult () -&gt; StateT SectionS ParseResult ()
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; StateT SectionS ParseResult ())
-&gt; ParseResult () -&gt; StateT SectionS ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702415"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Invalid name &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702414"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-400"></span><span>         </span><span class="annot"><span class="annottext">ByteString -&gt; SectionParser ByteString
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseCommonName"><span class="hs-identifier hs-type">parseCommonName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SectionArg"><span class="hs-identifier hs-type">SectionArg</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-403"></span><span id="parseCommonName"><span class="annot"><span class="annottext">parseCommonName :: Position -&gt; [SectionArg Position] -&gt; ParseResult String
</span><a href="Distribution.PackageDescription.Parsec.html#parseCommonName"><span class="hs-identifier hs-var hs-var">parseCommonName</span></a></span></span><span> </span><span id="local-6989586621679702408"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702408"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702407"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702407"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702407"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-404"></span><span>    </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SecArgName"><span class="hs-identifier hs-type">SecArgName</span></a></span><span> </span><span id="local-6989586621679702406"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702406"><span class="hs-identifier hs-var">_pos</span></a></span></span><span> </span><span id="local-6989586621679702405"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702405"><span class="hs-identifier hs-var">secName</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-405"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; ParseResult String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult String) -&gt; String -&gt; ParseResult String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String
</span><a href="Distribution.Utils.Generic.html#fromUTF8BS"><span class="hs-identifier hs-var">fromUTF8BS</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702405"><span class="hs-identifier hs-var">secName</span></a></span><span>
</span><span id="line-406"></span><span>    </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SecArgStr"><span class="hs-identifier hs-type">SecArgStr</span></a></span><span> </span><span id="local-6989586621679702404"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702404"><span class="hs-identifier hs-var">_pos</span></a></span></span><span> </span><span id="local-6989586621679702403"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702403"><span class="hs-identifier hs-var">secName</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-407"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; ParseResult String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult String) -&gt; String -&gt; ParseResult String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String
</span><a href="Distribution.Utils.Generic.html#fromUTF8BS"><span class="hs-identifier hs-var">fromUTF8BS</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702403"><span class="hs-identifier hs-var">secName</span></a></span><span>
</span><span id="line-408"></span><span>    </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-409"></span><span>         </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702408"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;name required&quot;</span></span><span>
</span><span id="line-410"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; ParseResult String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-411"></span><span>    </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-412"></span><span>         </span><span class="hs-comment">-- TODO: pretty print args</span><span>
</span><span id="line-413"></span><span>         </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702408"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Invalid name &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702407"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-414"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; ParseResult String
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-415"></span><span>
</span><span id="line-416"></span><span class="hs-comment">-- TODO: avoid conversion to 'String'.</span><span>
</span><span id="line-417"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseUnqualComponentName"><span class="hs-identifier hs-type">parseUnqualComponentName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#SectionArg"><span class="hs-identifier hs-type">SectionArg</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#SectionParser"><span class="hs-identifier hs-type">SectionParser</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnqualComponentName.html#UnqualComponentName"><span class="hs-identifier hs-type">UnqualComponentName</span></a></span><span>
</span><span id="line-418"></span><span id="parseUnqualComponentName"><span class="annot"><span class="annottext">parseUnqualComponentName :: Position
-&gt; [SectionArg Position] -&gt; SectionParser UnqualComponentName
</span><a href="Distribution.PackageDescription.Parsec.html#parseUnqualComponentName"><span class="hs-identifier hs-var hs-var">parseUnqualComponentName</span></a></span></span><span> </span><span id="local-6989586621679702402"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702402"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702401"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702401"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; UnqualComponentName
</span><a href="Distribution.Types.UnqualComponentName.html#mkUnqualComponentName"><span class="hs-identifier hs-var">mkUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; UnqualComponentName)
-&gt; StateT SectionS ParseResult String
-&gt; SectionParser UnqualComponentName
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Position
-&gt; [SectionArg Position] -&gt; StateT SectionS ParseResult String
</span><a href="Distribution.PackageDescription.Parsec.html#parseName"><span class="hs-identifier hs-var">parseName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702402"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702401"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-419"></span><span>
</span><span id="line-420"></span><span class="hs-comment">-- | Parse a non-recursive list of fields.</span><span>
</span><span id="line-421"></span><span id="local-6989586621679703588"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseFields"><span class="hs-identifier hs-type">parseFields</span></a></span><span>
</span><span id="line-422"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span>
</span><span id="line-423"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ fields to be parsed</span><span>
</span><span id="line-424"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.html#ParsecFieldGrammar%27"><span class="hs-identifier hs-type">ParsecFieldGrammar'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703588"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-425"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703588"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-426"></span><span id="parseFields"><span class="annot"><span class="annottext">parseFields :: forall a.
CabalSpecVersion
-&gt; [Field Position] -&gt; ParsecFieldGrammar' a -&gt; ParseResult a
</span><a href="Distribution.PackageDescription.Parsec.html#parseFields"><span class="hs-identifier hs-var hs-var">parseFields</span></a></span></span><span> </span><span id="local-6989586621679702394"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702394"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679702393"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702393"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span id="local-6989586621679702392"><span class="annot"><span class="annottext">ParsecFieldGrammar' a
</span><a href="#local-6989586621679702392"><span class="hs-identifier hs-var">grammar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-427"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679702391"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679702391"><span class="hs-identifier hs-var">fs0</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702390"><span class="annot"><span class="annottext">[[Section Position]]
</span><a href="#local-6989586621679702390"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; (Fields Position, [[Section Position]])
forall ann. [Field ann] -&gt; (Fields ann, [[Section ann]])
</span><a href="Distribution.FieldGrammar.html#partitionFields"><span class="hs-identifier hs-var">partitionFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702393"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-428"></span><span>    </span><span class="annot"><span class="annottext">([Section Position] -&gt; ParseResult ())
-&gt; [[Section Position]] -&gt; ParseResult ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#traverse_"><span class="hs-identifier hs-var">traverse_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Section Position -&gt; ParseResult ())
-&gt; [Section Position] -&gt; ParseResult ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#traverse_"><span class="hs-identifier hs-var">traverse_</span></a></span><span> </span><span class="annot"><span class="annottext">Section Position -&gt; ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#warnInvalidSubsection"><span class="hs-identifier hs-var">warnInvalidSubsection</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[[Section Position]]
</span><a href="#local-6989586621679702390"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-429"></span><span>    </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar' a -&gt; ParseResult a
forall s a.
CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar s a -&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#parseFieldGrammar"><span class="hs-identifier hs-var">parseFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702394"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679702391"><span class="hs-identifier hs-var">fs0</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' a
</span><a href="#local-6989586621679702392"><span class="hs-identifier hs-var">grammar</span></a></span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#warnInvalidSubsection"><span class="hs-identifier hs-type">warnInvalidSubsection</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span id="warnInvalidSubsection"><span class="annot"><span class="annottext">warnInvalidSubsection :: Section Position -&gt; ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#warnInvalidSubsection"><span class="hs-identifier hs-var hs-var">warnInvalidSubsection</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#MkSection"><span class="hs-identifier hs-type">MkSection</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702386"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702386"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702385"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702385"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-433"></span><span>    </span><span class="annot"><span class="annottext">ParseResult () -&gt; ParseResult ()
forall (f :: * -&gt; *) a. Functor f =&gt; f a -&gt; f ()
</span><a href="../../base/src/Data.Functor.html#void"><span class="hs-identifier hs-var">void</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; ParseResult ())
-&gt; ParseResult () -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702386"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid subsection &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702385"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-434"></span><span>
</span><span id="line-435"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseCondTree"><span class="hs-identifier hs-type">parseCondTree</span></a></span><span>
</span><span id="line-436"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679703576"><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.Lens.html#HasBuildInfo"><span class="hs-identifier hs-type">L.HasBuildInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-437"></span><span>    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span>
</span><span id="line-438"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#HasElif"><span class="hs-identifier hs-type">HasElif</span></a></span><span>                        </span><span class="hs-comment">-- ^ accept @elif@</span><span>
</span><span id="line-439"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.html#ParsecFieldGrammar%27"><span class="hs-identifier hs-type">ParsecFieldGrammar'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span><span>          </span><span class="hs-comment">-- ^ grammar</span><span>
</span><span id="line-440"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#CondTreeBuildInfo"><span class="hs-identifier hs-type">CondTreeBuildInfo</span></a></span><span>   </span><span class="hs-comment">-- ^ common stanzas</span><span>
</span><span id="line-441"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>               </span><span class="hs-comment">-- ^ constructor from buildInfo</span><span>
</span><span id="line-442"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>            </span><span class="hs-comment">-- ^ condition extractor</span><span>
</span><span id="line-443"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-444"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-445"></span><span id="parseCondTree"><span class="annot"><span class="annottext">parseCondTree :: forall a.
HasBuildInfo a =&gt;
CabalSpecVersion
-&gt; HasElif
-&gt; ParsecFieldGrammar' a
-&gt; Map String CondTreeBuildInfo
-&gt; (BuildInfo -&gt; a)
-&gt; (a -&gt; [Dependency])
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="Distribution.PackageDescription.Parsec.html#parseCondTree"><span class="hs-identifier hs-var hs-var">parseCondTree</span></a></span></span><span> </span><span id="local-6989586621679702344"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702344"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679702343"><span class="annot"><span class="annottext">HasElif
</span><a href="#local-6989586621679702343"><span class="hs-identifier hs-var">hasElif</span></a></span></span><span> </span><span id="local-6989586621679702342"><span class="annot"><span class="annottext">ParsecFieldGrammar' a
</span><a href="#local-6989586621679702342"><span class="hs-identifier hs-var">grammar</span></a></span></span><span> </span><span id="local-6989586621679702341"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702341"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span id="local-6989586621679702340"><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702340"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span></span><span> </span><span id="local-6989586621679702339"><span class="annot"><span class="annottext">a -&gt; [Dependency]
</span><a href="#local-6989586621679702339"><span class="hs-identifier hs-var">cond</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702338"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-446"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-447"></span><span>    </span><span id="local-6989586621679702338"><span class="annot"><span class="annottext">go :: [Field Position] -&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702338"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679702323"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702323"><span class="hs-identifier hs-var">fields0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-448"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679702322"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702322"><span class="hs-identifier hs-var">fields</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702321"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702321"><span class="hs-identifier hs-var">endo</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-449"></span><span>            </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702344"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV3_0"><span class="hs-identifier hs-var">CabalSpecV3_0</span></a></span><span>
</span><span id="line-450"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
forall a.
HasBuildInfo a =&gt;
CabalSpecVersion
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
</span><a href="Distribution.PackageDescription.Parsec.html#processImports"><span class="hs-identifier hs-var">processImports</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702344"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702340"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702341"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702323"><span class="hs-identifier hs-var">fields0</span></a></span><span>
</span><span id="line-451"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(Field Position -&gt; ParseResult (Maybe (Field Position)))
-&gt; [Field Position] -&gt; ParseResult [Maybe (Field Position)]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Field Position -&gt; ParseResult (Maybe (Field Position))
</span><a href="Distribution.PackageDescription.Parsec.html#warnImport"><span class="hs-identifier hs-var">warnImport</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702344"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702323"><span class="hs-identifier hs-var">fields0</span></a></span><span> </span><span class="annot"><span class="annottext">ParseResult [Maybe (Field Position)]
-&gt; ([Maybe (Field Position)]
    -&gt; ParseResult
         ([Field Position],
          CondTree ConfVar [Dependency] a
          -&gt; CondTree ConfVar [Dependency] a))
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679702317"><span class="annot"><span class="annottext">[Maybe (Field Position)]
</span><a href="#local-6989586621679702317"><span class="hs-identifier hs-var">fields1</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">([Field Position],
 CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Maybe (Field Position)] -&gt; [Field Position]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe (Field Position)]
</span><a href="#local-6989586621679702317"><span class="hs-identifier hs-var">fields1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679702315"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679702315"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702314"><span class="annot"><span class="annottext">[[Section Position]]
</span><a href="#local-6989586621679702314"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; (Fields Position, [[Section Position]])
forall ann. [Field ann] -&gt; (Fields ann, [[Section ann]])
</span><a href="Distribution.FieldGrammar.html#partitionFields"><span class="hs-identifier hs-var">partitionFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702322"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-454"></span><span>        </span><span id="local-6989586621679702313"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702313"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar' a -&gt; ParseResult a
forall s a.
CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar s a -&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#parseFieldGrammar"><span class="hs-identifier hs-var">parseFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702344"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679702315"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' a
</span><a href="#local-6989586621679702342"><span class="hs-identifier hs-var">grammar</span></a></span><span>
</span><span id="line-455"></span><span>        </span><span id="local-6989586621679702312"><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702312"><span class="hs-identifier hs-var">branches</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[[CondBranch ConfVar [Dependency] a]]
-&gt; [CondBranch ConfVar [Dependency] a]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">([[CondBranch ConfVar [Dependency] a]]
 -&gt; [CondBranch ConfVar [Dependency] a])
-&gt; ParseResult [[CondBranch ConfVar [Dependency] a]]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">([Section Position]
 -&gt; ParseResult [CondBranch ConfVar [Dependency] a])
-&gt; [[Section Position]]
-&gt; ParseResult [[CondBranch ConfVar [Dependency] a]]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702311"><span class="hs-identifier hs-var">parseIfs</span></a></span><span> </span><span class="annot"><span class="annottext">[[Section Position]]
</span><a href="#local-6989586621679702314"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-456"></span><span>        </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CondTree ConfVar [Dependency] a
 -&gt; ParseResult (CondTree ConfVar [Dependency] a))
-&gt; CondTree ConfVar [Dependency] a
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702321"><span class="hs-identifier hs-var">endo</span></a></span><span> </span><span class="annot"><span class="annottext">(CondTree ConfVar [Dependency] a
 -&gt; CondTree ConfVar [Dependency] a)
-&gt; CondTree ConfVar [Dependency] a
-&gt; CondTree ConfVar [Dependency] a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a
-&gt; [Dependency]
-&gt; [CondBranch ConfVar [Dependency] a]
-&gt; CondTree ConfVar [Dependency] a
forall v c a. a -&gt; c -&gt; [CondBranch v c a] -&gt; CondTree v c a
</span><a href="Distribution.Types.CondTree.html#CondNode"><span class="hs-identifier hs-var">CondNode</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702313"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; [Dependency]
</span><a href="#local-6989586621679702339"><span class="hs-identifier hs-var">cond</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702313"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702312"><span class="hs-identifier hs-var">branches</span></a></span><span>
</span><span id="line-457"></span><span>
</span><span id="line-458"></span><span>    </span><span class="annot"><a href="#local-6989586621679702311"><span class="hs-identifier hs-type">parseIfs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondBranch"><span class="hs-identifier hs-type">CondBranch</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-459"></span><span>    </span><span id="local-6989586621679702311"><span class="annot"><span class="annottext">parseIfs :: [Section Position]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702311"><span class="hs-identifier hs-var hs-var">parseIfs</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-460"></span><span>    </span><span class="annot"><a href="#local-6989586621679702311"><span class="hs-identifier hs-var">parseIfs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#MkSection"><span class="hs-identifier hs-type">MkSection</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702309"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702309"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679702308"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702308"><span class="hs-identifier hs-var">test</span></a></span></span><span> </span><span id="local-6989586621679702307"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702307"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679702306"><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702306"><span class="hs-identifier hs-var">sections</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702309"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;if&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-461"></span><span>        </span><span id="local-6989586621679702305"><span class="annot"><span class="annottext">Condition ConfVar
</span><a href="#local-6989586621679702305"><span class="hs-identifier hs-var">test'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; ParseResult (Condition ConfVar)
</span><a href="Distribution.Fields.ConfVar.html#parseConditionConfVar"><span class="hs-identifier hs-var">parseConditionConfVar</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702308"><span class="hs-identifier hs-var">test</span></a></span><span>
</span><span id="line-462"></span><span>        </span><span id="local-6989586621679702304"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702304"><span class="hs-identifier hs-var">fields'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702338"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702307"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-463"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679702303"><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702303"><span class="hs-identifier hs-var">elseFields</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702302"><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702302"><span class="hs-identifier hs-var">sections'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Section Position]
-&gt; ParseResult
     (Maybe (CondTree ConfVar [Dependency] a),
      [CondBranch ConfVar [Dependency] a])
</span><a href="#local-6989586621679702301"><span class="hs-identifier hs-var">parseElseIfs</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702306"><span class="hs-identifier hs-var">sections</span></a></span><span>
</span><span id="line-464"></span><span>        </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Condition ConfVar
-&gt; CondTree ConfVar [Dependency] a
-&gt; Maybe (CondTree ConfVar [Dependency] a)
-&gt; CondBranch ConfVar [Dependency] a
forall v c a.
Condition v
-&gt; CondTree v c a -&gt; Maybe (CondTree v c a) -&gt; CondBranch v c a
</span><a href="Distribution.Types.CondTree.html#CondBranch"><span class="hs-identifier hs-var">CondBranch</span></a></span><span> </span><span class="annot"><span class="annottext">Condition ConfVar
</span><a href="#local-6989586621679702305"><span class="hs-identifier hs-var">test'</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702304"><span class="hs-identifier hs-var">fields'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702303"><span class="hs-identifier hs-var">elseFields</span></a></span><span> </span><span class="annot"><span class="annottext">CondBranch ConfVar [Dependency] a
-&gt; [CondBranch ConfVar [Dependency] a]
-&gt; [CondBranch ConfVar [Dependency] a]
forall {a}. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702302"><span class="hs-identifier hs-var">sections'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-465"></span><span>    </span><span class="annot"><a href="#local-6989586621679702311"><span class="hs-identifier hs-var">parseIfs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#MkSection"><span class="hs-identifier hs-type">MkSection</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702299"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702299"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702298"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702298"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679702297"><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702297"><span class="hs-identifier hs-var">sections</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-466"></span><span>        </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702299"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTInvalidSubsection"><span class="hs-identifier hs-var">PWTInvalidSubsection</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid subsection &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702298"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-467"></span><span>        </span><span class="annot"><span class="annottext">[Section Position]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702311"><span class="hs-identifier hs-var">parseIfs</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702297"><span class="hs-identifier hs-var">sections</span></a></span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span>    </span><span class="annot"><a href="#local-6989586621679702301"><span class="hs-identifier hs-type">parseElseIfs</span></a></span><span>
</span><span id="line-470"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-471"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondBranch"><span class="hs-identifier hs-type">CondBranch</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703576"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-472"></span><span>    </span><span id="local-6989586621679702301"><span class="annot"><span class="annottext">parseElseIfs :: [Section Position]
-&gt; ParseResult
     (Maybe (CondTree ConfVar [Dependency] a),
      [CondBranch ConfVar [Dependency] a])
</span><a href="#local-6989586621679702301"><span class="hs-identifier hs-var hs-var">parseElseIfs</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe (CondTree ConfVar [Dependency] a),
 [CondBranch ConfVar [Dependency] a])
-&gt; ParseResult
     (Maybe (CondTree ConfVar [Dependency] a),
      [CondBranch ConfVar [Dependency] a])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] a)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-473"></span><span>    </span><span class="annot"><a href="#local-6989586621679702301"><span class="hs-identifier hs-var">parseElseIfs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#MkSection"><span class="hs-identifier hs-type">MkSection</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702295"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702295"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702294"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702294"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679702293"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702293"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679702292"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702292"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679702291"><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702291"><span class="hs-identifier hs-var">sections</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702294"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;else&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-474"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; ParseResult () -&gt; ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702293"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; ParseResult ())
-&gt; ParseResult () -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-475"></span><span>            </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702295"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;`else` section has section arguments &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702293"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-476"></span><span>        </span><span id="local-6989586621679702290"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702290"><span class="hs-identifier hs-var">elseFields</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702338"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702292"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-477"></span><span>        </span><span id="local-6989586621679702289"><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702289"><span class="hs-identifier hs-var">sections'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Section Position]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702311"><span class="hs-identifier hs-var">parseIfs</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702291"><span class="hs-identifier hs-var">sections</span></a></span><span>
</span><span id="line-478"></span><span>        </span><span class="annot"><span class="annottext">(Maybe (CondTree ConfVar [Dependency] a),
 [CondBranch ConfVar [Dependency] a])
-&gt; ParseResult
     (Maybe (CondTree ConfVar [Dependency] a),
      [CondBranch ConfVar [Dependency] a])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
-&gt; Maybe (CondTree ConfVar [Dependency] a)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702290"><span class="hs-identifier hs-var">elseFields</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702289"><span class="hs-identifier hs-var">sections'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span>    </span><span class="annot"><a href="#local-6989586621679702301"><span class="hs-identifier hs-var">parseElseIfs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#MkSection"><span class="hs-identifier hs-type">MkSection</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702288"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702288"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679702287"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702287"><span class="hs-identifier hs-var">test</span></a></span></span><span> </span><span id="local-6989586621679702286"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702286"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679702285"><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702285"><span class="hs-identifier hs-var">sections</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HasElif
</span><a href="#local-6989586621679702343"><span class="hs-identifier hs-var">hasElif</span></a></span><span> </span><span class="annot"><span class="annottext">HasElif -&gt; HasElif -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HasElif
</span><a href="Distribution.CabalSpecVersion.html#HasElif"><span class="hs-identifier hs-var">HasElif</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702288"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;elif&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-481"></span><span>        </span><span id="local-6989586621679702283"><span class="annot"><span class="annottext">Condition ConfVar
</span><a href="#local-6989586621679702283"><span class="hs-identifier hs-var">test'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[SectionArg Position] -&gt; ParseResult (Condition ConfVar)
</span><a href="Distribution.Fields.ConfVar.html#parseConditionConfVar"><span class="hs-identifier hs-var">parseConditionConfVar</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679702287"><span class="hs-identifier hs-var">test</span></a></span><span>
</span><span id="line-482"></span><span>        </span><span id="local-6989586621679702282"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702282"><span class="hs-identifier hs-var">fields'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702338"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702286"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-483"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679702281"><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702281"><span class="hs-identifier hs-var">elseFields</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702280"><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702280"><span class="hs-identifier hs-var">sections'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Section Position]
-&gt; ParseResult
     (Maybe (CondTree ConfVar [Dependency] a),
      [CondBranch ConfVar [Dependency] a])
</span><a href="#local-6989586621679702301"><span class="hs-identifier hs-var">parseElseIfs</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702285"><span class="hs-identifier hs-var">sections</span></a></span><span>
</span><span id="line-484"></span><span>        </span><span class="hs-comment">-- we parse an empty 'Fields', to get empty value for a node</span><span>
</span><span id="line-485"></span><span>        </span><span id="local-6989586621679702279"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702279"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar' a -&gt; ParseResult a
forall s a.
CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar s a -&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#parseFieldGrammar"><span class="hs-identifier hs-var">parseFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702344"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' a
</span><a href="#local-6989586621679702342"><span class="hs-identifier hs-var">grammar</span></a></span><span>
</span><span id="line-486"></span><span>        </span><span class="annot"><span class="annottext">(Maybe (CondTree ConfVar [Dependency] a),
 [CondBranch ConfVar [Dependency] a])
-&gt; ParseResult
     (Maybe (CondTree ConfVar [Dependency] a),
      [CondBranch ConfVar [Dependency] a])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
-&gt; Maybe (CondTree ConfVar [Dependency] a)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(CondTree ConfVar [Dependency] a
 -&gt; Maybe (CondTree ConfVar [Dependency] a))
-&gt; CondTree ConfVar [Dependency] a
-&gt; Maybe (CondTree ConfVar [Dependency] a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a
-&gt; [Dependency]
-&gt; [CondBranch ConfVar [Dependency] a]
-&gt; CondTree ConfVar [Dependency] a
forall v c a. a -&gt; c -&gt; [CondBranch v c a] -&gt; CondTree v c a
</span><a href="Distribution.Types.CondTree.html#CondNode"><span class="hs-identifier hs-var">CondNode</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702279"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; [Dependency]
</span><a href="#local-6989586621679702339"><span class="hs-identifier hs-var">cond</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702279"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Condition ConfVar
-&gt; CondTree ConfVar [Dependency] a
-&gt; Maybe (CondTree ConfVar [Dependency] a)
-&gt; CondBranch ConfVar [Dependency] a
forall v c a.
Condition v
-&gt; CondTree v c a -&gt; Maybe (CondTree v c a) -&gt; CondBranch v c a
</span><a href="Distribution.Types.CondTree.html#CondBranch"><span class="hs-identifier hs-var">CondBranch</span></a></span><span> </span><span class="annot"><span class="annottext">Condition ConfVar
</span><a href="#local-6989586621679702283"><span class="hs-identifier hs-var">test'</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702282"><span class="hs-identifier hs-var">fields'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702281"><span class="hs-identifier hs-var">elseFields</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702280"><span class="hs-identifier hs-var">sections'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span>    </span><span class="annot"><a href="#local-6989586621679702301"><span class="hs-identifier hs-var">parseElseIfs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#MkSection"><span class="hs-identifier hs-type">MkSection</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702278"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702278"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702277"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702277"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679702276"><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702276"><span class="hs-identifier hs-var">sections</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702277"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;elif&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-489"></span><span>        </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702278"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTInvalidSubsection"><span class="hs-identifier hs-var">PWTInvalidSubsection</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid subsection \&quot;elif\&quot;. You should set cabal-version: 2.2 or larger to use elif-conditionals.&quot;</span></span><span>
</span><span id="line-490"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] a)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">([CondBranch ConfVar [Dependency] a]
 -&gt; (Maybe (CondTree ConfVar [Dependency] a),
     [CondBranch ConfVar [Dependency] a]))
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
-&gt; ParseResult
     (Maybe (CondTree ConfVar [Dependency] a),
      [CondBranch ConfVar [Dependency] a])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702311"><span class="hs-identifier hs-var">parseIfs</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702276"><span class="hs-identifier hs-var">sections</span></a></span><span>
</span><span id="line-491"></span><span>
</span><span id="line-492"></span><span>    </span><span class="annot"><a href="#local-6989586621679702301"><span class="hs-identifier hs-var">parseElseIfs</span></a></span><span> </span><span id="local-6989586621679702275"><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702275"><span class="hs-identifier hs-var">sections</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (CondTree ConfVar [Dependency] a)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">([CondBranch ConfVar [Dependency] a]
 -&gt; (Maybe (CondTree ConfVar [Dependency] a),
     [CondBranch ConfVar [Dependency] a]))
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
-&gt; ParseResult
     (Maybe (CondTree ConfVar [Dependency] a),
      [CondBranch ConfVar [Dependency] a])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
-&gt; ParseResult [CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702311"><span class="hs-identifier hs-var">parseIfs</span></a></span><span> </span><span class="annot"><span class="annottext">[Section Position]
</span><a href="#local-6989586621679702275"><span class="hs-identifier hs-var">sections</span></a></span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span class="hs-comment">{- Note [Accumulating parser]

Note: Outdated a bit

In there parser, @'FieldDescr' a@ is transformed into @Map FieldName (a -&gt;
FieldParser a)@.  The weird value is used because we accumulate structure of
@a@ by folding over the fields.  There are various reasons for that:

* Almost all fields are optional

* This is simple approach so declarative bi-directional format (parsing and
printing) of structure could be specified (list of @'FieldDescr' a@)

* There are surface syntax fields corresponding to single field in the file:
  @license-file@ and @license-files@

* This is quite safe approach.

When/if we re-implement the parser to support formatting preservging roundtrip
with new AST, this all need to be rewritten.
-}</span><span>
</span><span id="line-515"></span><span>
</span><span id="line-516"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-517"></span><span class="hs-comment">-- Common stanzas</span><span>
</span><span id="line-518"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-519"></span><span>
</span><span id="line-520"></span><span class="hs-comment">-- $commonStanzas</span><span>
</span><span id="line-521"></span><span class="hs-comment">--</span><span>
</span><span id="line-522"></span><span class="hs-comment">-- [Note: Common stanzas]</span><span>
</span><span id="line-523"></span><span class="hs-comment">--</span><span>
</span><span id="line-524"></span><span class="hs-comment">-- In Cabal 2.2 we support simple common stanzas:</span><span>
</span><span id="line-525"></span><span class="hs-comment">--</span><span>
</span><span id="line-526"></span><span class="hs-comment">-- * Commons stanzas define 'BuildInfo'</span><span>
</span><span id="line-527"></span><span class="hs-comment">--</span><span>
</span><span id="line-528"></span><span class="hs-comment">-- * import &quot;fields&quot; can only occur at top of other stanzas (think: imports)</span><span>
</span><span id="line-529"></span><span class="hs-comment">--</span><span>
</span><span id="line-530"></span><span class="hs-comment">-- In particular __there aren't__</span><span>
</span><span id="line-531"></span><span class="hs-comment">--</span><span>
</span><span id="line-532"></span><span class="hs-comment">-- * implicit stanzas</span><span>
</span><span id="line-533"></span><span class="hs-comment">--</span><span>
</span><span id="line-534"></span><span class="hs-comment">-- * More specific common stanzas (executable, test-suite).</span><span>
</span><span id="line-535"></span><span class="hs-comment">--</span><span>
</span><span id="line-536"></span><span class="hs-comment">--</span><span>
</span><span id="line-537"></span><span class="hs-comment">-- The approach uses the fact that 'BuildInfo' is a 'Monoid':</span><span>
</span><span id="line-538"></span><span class="hs-comment">--</span><span>
</span><span id="line-539"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-540"></span><span class="hs-comment">-- mergeCommonStanza' :: HasBuildInfo comp =&gt; BuildInfo -&gt; comp -&gt; comp</span><span>
</span><span id="line-541"></span><span class="hs-comment">-- mergeCommonStanza' bi = over L.BuildInfo (bi &lt;&gt;)</span><span>
</span><span id="line-542"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-543"></span><span class="hs-comment">--</span><span>
</span><span id="line-544"></span><span class="hs-comment">-- Real 'mergeCommonStanza' is more complicated as we have to deal with</span><span>
</span><span id="line-545"></span><span class="hs-comment">-- conditional trees.</span><span>
</span><span id="line-546"></span><span class="hs-comment">--</span><span>
</span><span id="line-547"></span><span class="hs-comment">-- The approach is simple, and have good properties:</span><span>
</span><span id="line-548"></span><span class="hs-comment">--</span><span>
</span><span id="line-549"></span><span class="hs-comment">-- * Common stanzas are parsed exactly once, even if not-used. Thus we report errors in them.</span><span>
</span><span id="line-550"></span><span class="hs-comment">--</span><span>
</span><span id="line-551"></span><span class="hs-keyword">type</span><span> </span><span id="CondTreeBuildInfo"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#CondTreeBuildInfo"><span class="hs-identifier hs-var">CondTreeBuildInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span class="hs-comment">-- | Create @a@ from 'BuildInfo'.</span><span>
</span><span id="line-554"></span><span class="hs-comment">-- This class is used to implement common stanza parsing.</span><span>
</span><span id="line-555"></span><span class="hs-comment">--</span><span>
</span><span id="line-556"></span><span class="hs-comment">-- Law: @view buildInfo . fromBuildInfo = id@</span><span>
</span><span id="line-557"></span><span class="hs-comment">--</span><span>
</span><span id="line-558"></span><span class="hs-comment">-- This takes name, as 'FieldGrammar's take names too.</span><span>
</span><span id="line-559"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.Lens.html#HasBuildInfo"><span class="hs-identifier hs-type">L.HasBuildInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703611"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="FromBuildInfo"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#FromBuildInfo"><span class="hs-identifier hs-var">FromBuildInfo</span></a></span></span><span> </span><span id="local-6989586621679703611"><span class="annot"><a href="#local-6989586621679703611"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-560"></span><span>    </span><span id="fromBuildInfo%27"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#fromBuildInfo%27"><span class="hs-identifier hs-type">fromBuildInfo'</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.UnqualComponentName.html#UnqualComponentName"><span class="hs-identifier hs-type">UnqualComponentName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679703611"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-561"></span><span>
</span><span id="line-562"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#libraryFromBuildInfo"><span class="hs-identifier hs-type">libraryFromBuildInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.LibraryName.html#LibraryName"><span class="hs-identifier hs-type">LibraryName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.Library.html#Library"><span class="hs-identifier hs-type">Library</span></a></span><span>
</span><span id="line-563"></span><span id="libraryFromBuildInfo"><span class="annot"><span class="annottext">libraryFromBuildInfo :: LibraryName -&gt; BuildInfo -&gt; Library
</span><a href="Distribution.PackageDescription.Parsec.html#libraryFromBuildInfo"><span class="hs-identifier hs-var hs-var">libraryFromBuildInfo</span></a></span></span><span> </span><span id="local-6989586621679702273"><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679702273"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679702272"><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702272"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Library
</span><a href="Distribution.Types.Library.html#emptyLibrary"><span class="hs-identifier hs-var">emptyLibrary</span></a></span><span>
</span><span id="line-564"></span><span>    </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">libName :: LibraryName
</span><a href="Distribution.Types.Library.html#libName"><span class="hs-identifier hs-var">libName</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679702273"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-565"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">libVisibility :: LibraryVisibility
</span><a href="Distribution.Types.Library.html#libVisibility"><span class="hs-identifier hs-var">libVisibility</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679702273"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-566"></span><span>        </span><span class="annot"><span class="annottext">LibraryName
</span><a href="Distribution.Types.LibraryName.html#LMainLibName"><span class="hs-identifier hs-var">LMainLibName</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LibraryVisibility
</span><a href="Distribution.Types.LibraryVisibility.html#LibraryVisibilityPublic"><span class="hs-identifier hs-var">LibraryVisibilityPublic</span></a></span><span>
</span><span id="line-567"></span><span>        </span><span class="annot"><a href="Distribution.Types.LibraryName.html#LSubLibName"><span class="hs-identifier hs-type">LSubLibName</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LibraryVisibility
</span><a href="Distribution.Types.LibraryVisibility.html#LibraryVisibilityPrivate"><span class="hs-identifier hs-var">LibraryVisibilityPrivate</span></a></span><span>
</span><span id="line-568"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">libBuildInfo :: BuildInfo
</span><a href="Distribution.Types.Library.html#libBuildInfo"><span class="hs-identifier hs-var">libBuildInfo</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702272"><span class="hs-identifier hs-var">bi</span></a></span><span>
</span><span id="line-569"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-570"></span><span>
</span><span id="line-571"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#FromBuildInfo"><span class="hs-identifier hs-type">FromBuildInfo</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679702260"><span class="annot"><span class="annottext">fromBuildInfo' :: UnqualComponentName -&gt; BuildInfo -&gt; BuildInfo
</span><a href="#local-6989586621679702260"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromBuildInfo'</span></a></span></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; BuildInfo
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-572"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#FromBuildInfo"><span class="hs-identifier hs-type">FromBuildInfo</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ForeignLib.html#ForeignLib"><span class="hs-identifier hs-type">ForeignLib</span></a></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679702253"><span class="annot"><span class="annottext">fromBuildInfo' :: UnqualComponentName -&gt; BuildInfo -&gt; ForeignLib
</span><a href="#local-6989586621679702253"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromBuildInfo'</span></a></span></span><span> </span><span id="local-6989586621679702252"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702252"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679702251"><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702251"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ASetter
  ForeignLib ForeignLib UnqualComponentName UnqualComponentName
-&gt; UnqualComponentName -&gt; ForeignLib -&gt; ForeignLib
forall s t a b. ASetter s t a b -&gt; b -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#set"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter
  ForeignLib ForeignLib UnqualComponentName UnqualComponentName
Lens' ForeignLib UnqualComponentName
</span><a href="Distribution.Types.ForeignLib.Lens.html#foreignLibName"><span class="hs-identifier hs-var">L.foreignLibName</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702252"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">(ForeignLib -&gt; ForeignLib) -&gt; ForeignLib -&gt; ForeignLib
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter ForeignLib ForeignLib BuildInfo BuildInfo
-&gt; BuildInfo -&gt; ForeignLib -&gt; ForeignLib
forall s t a b. ASetter s t a b -&gt; b -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#set"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter ForeignLib ForeignLib BuildInfo BuildInfo
forall a. HasBuildInfo a =&gt; Lens' a BuildInfo
</span><a href="Distribution.Types.BuildInfo.Lens.html#buildInfo"><span class="hs-identifier hs-var">L.buildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702251"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLib
</span><a href="Distribution.Types.ForeignLib.html#emptyForeignLib"><span class="hs-identifier hs-var">emptyForeignLib</span></a></span><span>
</span><span id="line-573"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#FromBuildInfo"><span class="hs-identifier hs-type">FromBuildInfo</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Executable.html#Executable"><span class="hs-identifier hs-type">Executable</span></a></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679702240"><span class="annot"><span class="annottext">fromBuildInfo' :: UnqualComponentName -&gt; BuildInfo -&gt; Executable
</span><a href="#local-6989586621679702240"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromBuildInfo'</span></a></span></span><span> </span><span id="local-6989586621679702239"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702239"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679702238"><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702238"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ASetter
  Executable Executable UnqualComponentName UnqualComponentName
-&gt; UnqualComponentName -&gt; Executable -&gt; Executable
forall s t a b. ASetter s t a b -&gt; b -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#set"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter
  Executable Executable UnqualComponentName UnqualComponentName
Lens' Executable UnqualComponentName
</span><a href="Distribution.Types.Executable.Lens.html#exeName"><span class="hs-identifier hs-var">L.exeName</span></a></span><span>        </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702239"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">(Executable -&gt; Executable) -&gt; Executable -&gt; Executable
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter Executable Executable BuildInfo BuildInfo
-&gt; BuildInfo -&gt; Executable -&gt; Executable
forall s t a b. ASetter s t a b -&gt; b -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#set"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter Executable Executable BuildInfo BuildInfo
forall a. HasBuildInfo a =&gt; Lens' a BuildInfo
</span><a href="Distribution.Types.BuildInfo.Lens.html#buildInfo"><span class="hs-identifier hs-var">L.buildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702238"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="annot"><span class="annottext">Executable
</span><a href="Distribution.Types.Executable.html#emptyExecutable"><span class="hs-identifier hs-var">emptyExecutable</span></a></span><span>
</span><span id="line-574"></span><span>
</span><span id="line-575"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#FromBuildInfo"><span class="hs-identifier hs-type">FromBuildInfo</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.FieldGrammar.html#TestSuiteStanza"><span class="hs-identifier hs-type">TestSuiteStanza</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-576"></span><span>    </span><span id="local-6989586621679702232"><span class="annot"><span class="annottext">fromBuildInfo' :: UnqualComponentName -&gt; BuildInfo -&gt; TestSuiteStanza
</span><a href="#local-6989586621679702232"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromBuildInfo'</span></a></span></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702231"><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702231"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe TestType
-&gt; Maybe String -&gt; Maybe ModuleName -&gt; BuildInfo -&gt; TestSuiteStanza
</span><a href="Distribution.PackageDescription.FieldGrammar.html#TestSuiteStanza"><span class="hs-identifier hs-var">TestSuiteStanza</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe TestType
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702231"><span class="hs-identifier hs-var">bi</span></a></span><span>
</span><span id="line-577"></span><span>
</span><span id="line-578"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#FromBuildInfo"><span class="hs-identifier hs-type">FromBuildInfo</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.FieldGrammar.html#BenchmarkStanza"><span class="hs-identifier hs-type">BenchmarkStanza</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-579"></span><span>    </span><span id="local-6989586621679702226"><span class="annot"><span class="annottext">fromBuildInfo' :: UnqualComponentName -&gt; BuildInfo -&gt; BenchmarkStanza
</span><a href="#local-6989586621679702226"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromBuildInfo'</span></a></span></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702225"><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702225"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BenchmarkType
-&gt; Maybe String -&gt; Maybe ModuleName -&gt; BuildInfo -&gt; BenchmarkStanza
</span><a href="Distribution.PackageDescription.FieldGrammar.html#BenchmarkStanza"><span class="hs-identifier hs-var">BenchmarkStanza</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BenchmarkType
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702225"><span class="hs-identifier hs-var">bi</span></a></span><span>
</span><span id="line-580"></span><span>
</span><span id="line-581"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseCondTreeWithCommonStanzas"><span class="hs-identifier hs-type">parseCondTreeWithCommonStanzas</span></a></span><span>
</span><span id="line-582"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679703640"><span class="annot"><a href="#local-6989586621679703640"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.Lens.html#HasBuildInfo"><span class="hs-identifier hs-type">L.HasBuildInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703640"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-583"></span><span>    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span>
</span><span id="line-584"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.html#ParsecFieldGrammar%27"><span class="hs-identifier hs-type">ParsecFieldGrammar'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703640"><span class="hs-identifier hs-type">a</span></a></span><span>       </span><span class="hs-comment">-- ^ grammar</span><span>
</span><span id="line-585"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679703640"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>              </span><span class="hs-comment">-- ^ construct fromBuildInfo</span><span>
</span><span id="line-586"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#CondTreeBuildInfo"><span class="hs-identifier hs-type">CondTreeBuildInfo</span></a></span><span>  </span><span class="hs-comment">-- ^ common stanzas</span><span>
</span><span id="line-587"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-588"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703640"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-589"></span><span id="parseCondTreeWithCommonStanzas"><span class="annot"><span class="annottext">parseCondTreeWithCommonStanzas :: forall a.
HasBuildInfo a =&gt;
CabalSpecVersion
-&gt; ParsecFieldGrammar' a
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="Distribution.PackageDescription.Parsec.html#parseCondTreeWithCommonStanzas"><span class="hs-identifier hs-var hs-var">parseCondTreeWithCommonStanzas</span></a></span></span><span> </span><span id="local-6989586621679702215"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702215"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679702214"><span class="annot"><span class="annottext">ParsecFieldGrammar' a
</span><a href="#local-6989586621679702214"><span class="hs-identifier hs-var">grammar</span></a></span></span><span> </span><span id="local-6989586621679702213"><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702213"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span></span><span> </span><span id="local-6989586621679702212"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702212"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span id="local-6989586621679702211"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702211"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-590"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679702210"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702210"><span class="hs-identifier hs-var">fields'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702209"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702209"><span class="hs-identifier hs-var">endo</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
forall a.
HasBuildInfo a =&gt;
CabalSpecVersion
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
</span><a href="Distribution.PackageDescription.Parsec.html#processImports"><span class="hs-identifier hs-var">processImports</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702215"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702213"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702212"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702211"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-591"></span><span>    </span><span id="local-6989586621679702208"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702208"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; HasElif
-&gt; ParsecFieldGrammar' a
-&gt; Map String CondTreeBuildInfo
-&gt; (BuildInfo -&gt; a)
-&gt; (a -&gt; [Dependency])
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
forall a.
HasBuildInfo a =&gt;
CabalSpecVersion
-&gt; HasElif
-&gt; ParsecFieldGrammar' a
-&gt; Map String CondTreeBuildInfo
-&gt; (BuildInfo -&gt; a)
-&gt; (a -&gt; [Dependency])
-&gt; [Field Position]
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
</span><a href="Distribution.PackageDescription.Parsec.html#parseCondTree"><span class="hs-identifier hs-var">parseCondTree</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702215"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">HasElif
</span><a href="#local-6989586621679702207"><span class="hs-identifier hs-var">hasElif</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' a
</span><a href="#local-6989586621679702214"><span class="hs-identifier hs-var">grammar</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702212"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702213"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Getting [Dependency] a [Dependency] -&gt; a -&gt; [Dependency]
forall a s. Getting a s a -&gt; s -&gt; a
</span><a href="Distribution.Compat.Lens.html#view"><span class="hs-identifier hs-var">view</span></a></span><span> </span><span class="annot"><span class="annottext">Getting [Dependency] a [Dependency]
forall a. HasBuildInfo a =&gt; Lens' a [Dependency]
</span><a href="Distribution.Types.BuildInfo.Lens.html#targetBuildDepends"><span class="hs-identifier hs-var">L.targetBuildDepends</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702210"><span class="hs-identifier hs-var">fields'</span></a></span><span>
</span><span id="line-592"></span><span>    </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
-&gt; ParseResult (CondTree ConfVar [Dependency] a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702209"><span class="hs-identifier hs-var">endo</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702208"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-593"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-594"></span><span>    </span><span id="local-6989586621679702207"><span class="annot"><span class="annottext">hasElif :: HasElif
</span><a href="#local-6989586621679702207"><span class="hs-identifier hs-var hs-var">hasElif</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; HasElif
</span><a href="Distribution.CabalSpecVersion.html#specHasElif"><span class="hs-identifier hs-var">specHasElif</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702215"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-595"></span><span>
</span><span id="line-596"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#processImports"><span class="hs-identifier hs-type">processImports</span></a></span><span>
</span><span id="line-597"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679703571"><span class="annot"><a href="#local-6989586621679703571"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.Lens.html#HasBuildInfo"><span class="hs-identifier hs-type">L.HasBuildInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703571"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-598"></span><span>    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span>
</span><span id="line-599"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679703571"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>              </span><span class="hs-comment">-- ^ construct fromBuildInfo</span><span>
</span><span id="line-600"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#CondTreeBuildInfo"><span class="hs-identifier hs-type">CondTreeBuildInfo</span></a></span><span>  </span><span class="hs-comment">-- ^ common stanzas</span><span>
</span><span id="line-601"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-602"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703571"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703571"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-603"></span><span id="processImports"><span class="annot"><span class="annottext">processImports :: forall a.
HasBuildInfo a =&gt;
CabalSpecVersion
-&gt; (BuildInfo -&gt; a)
-&gt; Map String CondTreeBuildInfo
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
</span><a href="Distribution.PackageDescription.Parsec.html#processImports"><span class="hs-identifier hs-var hs-var">processImports</span></a></span></span><span> </span><span id="local-6989586621679702201"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702201"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679702200"><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702200"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span></span><span> </span><span id="local-6989586621679702199"><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702199"><span class="hs-identifier hs-var">commonStanzas</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CondTreeBuildInfo]
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702198"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-604"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-605"></span><span>    </span><span id="local-6989586621679702197"><span class="annot"><span class="annottext">hasCommonStanzas :: HasCommonStanzas
</span><a href="#local-6989586621679702197"><span class="hs-identifier hs-var hs-var">hasCommonStanzas</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; HasCommonStanzas
</span><a href="Distribution.CabalSpecVersion.html#specHasCommonStanzas"><span class="hs-identifier hs-var">specHasCommonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702201"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-606"></span><span>
</span><span id="line-607"></span><span>    </span><span class="annot"><a href="#local-6989586621679702196"><span class="hs-identifier hs-type">getList'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Newtypes.html#List"><span class="hs-identifier hs-type">List</span></a></span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Newtypes.html#CommaFSep"><span class="hs-identifier hs-type">CommaFSep</span></a></span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Newtypes.html#Token"><span class="hs-identifier hs-type">Token</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-608"></span><span>    </span><span id="local-6989586621679702196"><span class="annot"><span class="annottext">getList' :: List CommaFSep Token String -&gt; [String]
</span><a href="#local-6989586621679702196"><span class="hs-identifier hs-var hs-var">getList'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">List CommaFSep Token String -&gt; [String]
forall o n. Newtype o n =&gt; n -&gt; o
</span><a href="Distribution.Compat.Newtype.html#unpack"><span class="hs-identifier hs-var">Newtype.unpack</span></a></span><span>
</span><span id="line-609"></span><span>
</span><span id="line-610"></span><span>    </span><span id="local-6989586621679702198"><span class="annot"><span class="annottext">go :: [CondTreeBuildInfo]
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702198"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679702164"><span class="annot"><span class="annottext">[CondTreeBuildInfo]
</span><a href="#local-6989586621679702164"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702163"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702163"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702162"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702162"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679702161"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702161"><span class="hs-identifier hs-var">fields</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702162"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;import&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HasCommonStanzas
</span><a href="#local-6989586621679702197"><span class="hs-identifier hs-var">hasCommonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">HasCommonStanzas -&gt; HasCommonStanzas -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HasCommonStanzas
</span><a href="Distribution.CabalSpecVersion.html#NoCommonStanzas"><span class="hs-identifier hs-var">NoCommonStanzas</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-611"></span><span>        </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702163"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTUnknownField"><span class="hs-identifier hs-var">PWTUnknownField</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unknown field: import. You should set cabal-version: 2.2 or larger to use common stanzas&quot;</span></span><span>
</span><span id="line-612"></span><span>        </span><span class="annot"><span class="annottext">[CondTreeBuildInfo]
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702198"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[CondTreeBuildInfo]
</span><a href="#local-6989586621679702164"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702161"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-613"></span><span>    </span><span class="hs-comment">-- supported:</span><span>
</span><span id="line-614"></span><span>    </span><span class="annot"><a href="#local-6989586621679702198"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679702159"><span class="annot"><span class="annottext">[CondTreeBuildInfo]
</span><a href="#local-6989586621679702159"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702158"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702158"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702157"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702157"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679702156"><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679702156"><span class="hs-identifier hs-var">fls</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679702155"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702155"><span class="hs-identifier hs-var">fields</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702157"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;import&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-615"></span><span>        </span><span id="local-6989586621679702154"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679702154"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">List CommaFSep Token String -&gt; [String]
</span><a href="#local-6989586621679702196"><span class="hs-identifier hs-var">getList'</span></a></span><span> </span><span class="annot"><span class="annottext">(List CommaFSep Token String -&gt; [String])
-&gt; ParseResult (List CommaFSep Token String)
-&gt; ParseResult [String]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Position
-&gt; ParsecParser (List CommaFSep Token String)
-&gt; CabalSpecVersion
-&gt; [FieldLine Position]
-&gt; ParseResult (List CommaFSep Token String)
forall a.
Position
-&gt; ParsecParser a
-&gt; CabalSpecVersion
-&gt; [FieldLine Position]
-&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#runFieldParser"><span class="hs-identifier hs-var">runFieldParser</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702158"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecParser (List CommaFSep Token String)
forall a (m :: * -&gt; *). (Parsec a, CabalParsing m) =&gt; m a
</span><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier hs-var">parsec</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702201"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679702156"><span class="hs-identifier hs-var">fls</span></a></span><span>
</span><span id="line-616"></span><span>        </span><span id="local-6989586621679702153"><span class="annot"><span class="annottext">[Maybe CondTreeBuildInfo]
</span><a href="#local-6989586621679702153"><span class="hs-identifier hs-var">names'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String]
-&gt; (String -&gt; ParseResult (Maybe CondTreeBuildInfo))
-&gt; ParseResult [Maybe CondTreeBuildInfo]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
t a -&gt; (a -&gt; f b) -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#for"><span class="hs-identifier hs-var">for</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679702154"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">((String -&gt; ParseResult (Maybe CondTreeBuildInfo))
 -&gt; ParseResult [Maybe CondTreeBuildInfo])
-&gt; (String -&gt; ParseResult (Maybe CondTreeBuildInfo))
-&gt; ParseResult [Maybe CondTreeBuildInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679702151"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679702151"><span class="hs-identifier hs-var">commonName</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-617"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; Map String CondTreeBuildInfo -&gt; Maybe CondTreeBuildInfo
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679702151"><span class="hs-identifier hs-var">commonName</span></a></span><span> </span><span class="annot"><span class="annottext">Map String CondTreeBuildInfo
</span><a href="#local-6989586621679702199"><span class="hs-identifier hs-var">commonStanzas</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-618"></span><span>                </span><span class="annot"><span class="annottext">Maybe CondTreeBuildInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-619"></span><span>                    </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702158"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Undefined common stanza imported: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679702151"><span class="hs-identifier hs-var">commonName</span></a></span><span>
</span><span id="line-620"></span><span>                    </span><span class="annot"><span class="annottext">Maybe CondTreeBuildInfo -&gt; ParseResult (Maybe CondTreeBuildInfo)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CondTreeBuildInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-621"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679702150"><span class="annot"><span class="annottext">CondTreeBuildInfo
</span><a href="#local-6989586621679702150"><span class="hs-identifier hs-var">commonTree</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-622"></span><span>                    </span><span class="annot"><span class="annottext">Maybe CondTreeBuildInfo -&gt; ParseResult (Maybe CondTreeBuildInfo)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CondTreeBuildInfo -&gt; Maybe CondTreeBuildInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CondTreeBuildInfo
</span><a href="#local-6989586621679702150"><span class="hs-identifier hs-var">commonTree</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-623"></span><span>
</span><span id="line-624"></span><span>        </span><span class="annot"><span class="annottext">[CondTreeBuildInfo]
-&gt; [Field Position]
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
</span><a href="#local-6989586621679702198"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CondTreeBuildInfo]
</span><a href="#local-6989586621679702159"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">[CondTreeBuildInfo] -&gt; [CondTreeBuildInfo] -&gt; [CondTreeBuildInfo]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe CondTreeBuildInfo] -&gt; [CondTreeBuildInfo]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe CondTreeBuildInfo]
</span><a href="#local-6989586621679702153"><span class="hs-identifier hs-var">names'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702155"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-625"></span><span>
</span><span id="line-626"></span><span>    </span><span class="hs-comment">-- parse actual CondTree</span><span>
</span><span id="line-627"></span><span>    </span><span class="annot"><a href="#local-6989586621679702198"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679702149"><span class="annot"><span class="annottext">[CondTreeBuildInfo]
</span><a href="#local-6989586621679702149"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621679702148"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702148"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-628"></span><span>        </span><span id="local-6989586621679702147"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702147"><span class="hs-identifier hs-var">fields'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Maybe (Field Position)] -&gt; [Field Position]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">([Maybe (Field Position)] -&gt; [Field Position])
-&gt; ParseResult [Maybe (Field Position)]
-&gt; ParseResult [Field Position]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(Field Position -&gt; ParseResult (Maybe (Field Position)))
-&gt; [Field Position] -&gt; ParseResult [Maybe (Field Position)]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Field Position -&gt; ParseResult (Maybe (Field Position))
</span><a href="Distribution.PackageDescription.Parsec.html#warnImport"><span class="hs-identifier hs-var">warnImport</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702201"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702148"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-629"></span><span>        </span><span class="annot"><span class="annottext">([Field Position],
 CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(([Field Position],
  CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
 -&gt; ParseResult
      ([Field Position],
       CondTree ConfVar [Dependency] a
       -&gt; CondTree ConfVar [Dependency] a))
-&gt; ([Field Position],
    CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
-&gt; ParseResult
     ([Field Position],
      CondTree ConfVar [Dependency] a -&gt; CondTree ConfVar [Dependency] a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679702147"><span class="hs-identifier hs-var">fields'</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679702146"><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702146"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(CondTreeBuildInfo
 -&gt; CondTree ConfVar [Dependency] a
 -&gt; CondTree ConfVar [Dependency] a)
-&gt; CondTree ConfVar [Dependency] a
-&gt; [CondTreeBuildInfo]
-&gt; CondTree ConfVar [Dependency] a
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(BuildInfo -&gt; a)
-&gt; CondTreeBuildInfo
-&gt; CondTree ConfVar [Dependency] a
-&gt; CondTree ConfVar [Dependency] a
forall a.
HasBuildInfo a =&gt;
(BuildInfo -&gt; a)
-&gt; CondTreeBuildInfo
-&gt; CondTree ConfVar [Dependency] a
-&gt; CondTree ConfVar [Dependency] a
</span><a href="Distribution.PackageDescription.Parsec.html#mergeCommonStanza"><span class="hs-identifier hs-var">mergeCommonStanza</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702200"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] a
</span><a href="#local-6989586621679702146"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[CondTreeBuildInfo]
</span><a href="#local-6989586621679702149"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-630"></span><span>
</span><span id="line-631"></span><span class="hs-comment">-- | Warn on &quot;import&quot; fields, also map to Maybe, so errorneous fields can be filtered</span><span>
</span><span id="line-632"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#warnImport"><span class="hs-identifier hs-type">warnImport</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-633"></span><span id="warnImport"><span class="annot"><span class="annottext">warnImport :: CabalSpecVersion
-&gt; Field Position -&gt; ParseResult (Maybe (Field Position))
</span><a href="Distribution.PackageDescription.Parsec.html#warnImport"><span class="hs-identifier hs-var hs-var">warnImport</span></a></span></span><span> </span><span id="local-6989586621679702143"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702143"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679702142"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702142"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679702141"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702141"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679702141"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span>  </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;import&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-634"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; HasCommonStanzas
</span><a href="Distribution.CabalSpecVersion.html#specHasCommonStanzas"><span class="hs-identifier hs-var">specHasCommonStanzas</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702143"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">HasCommonStanzas -&gt; HasCommonStanzas -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HasCommonStanzas
</span><a href="Distribution.CabalSpecVersion.html#NoCommonStanzas"><span class="hs-identifier hs-var">NoCommonStanzas</span></a></span><span>
</span><span id="line-635"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702142"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTUnknownField"><span class="hs-identifier hs-var">PWTUnknownField</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unknown field: import. You should set cabal-version: 2.2 or larger to use common stanzas&quot;</span></span><span>
</span><span id="line-636"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Position -&gt; PWarnType -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarning"><span class="hs-identifier hs-var">parseWarning</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679702142"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTUnknownField"><span class="hs-identifier hs-var">PWTUnknownField</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unknown field: import. Common stanza imports should be at the top of the enclosing section&quot;</span></span><span>
</span><span id="line-637"></span><span>    </span><span class="annot"><span class="annottext">Maybe (Field Position) -&gt; ParseResult (Maybe (Field Position))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Field Position)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-638"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#warnImport"><span class="hs-identifier hs-var">warnImport</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702140"><span class="annot"><span class="annottext">Field Position
</span><a href="#local-6989586621679702140"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Field Position) -&gt; ParseResult (Maybe (Field Position))
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Field Position -&gt; Maybe (Field Position)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Field Position
</span><a href="#local-6989586621679702140"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-639"></span><span>
</span><span id="line-640"></span><span id="local-6989586621679703548"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#mergeCommonStanza"><span class="hs-identifier hs-type">mergeCommonStanza</span></a></span><span>
</span><span id="line-641"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.Lens.html#HasBuildInfo"><span class="hs-identifier hs-type">L.HasBuildInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703548"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-642"></span><span>    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679703548"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-643"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span>
</span><span id="line-644"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703548"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-645"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679703548"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-646"></span><span id="mergeCommonStanza"><span class="annot"><span class="annottext">mergeCommonStanza :: forall a.
HasBuildInfo a =&gt;
(BuildInfo -&gt; a)
-&gt; CondTreeBuildInfo
-&gt; CondTree ConfVar [Dependency] a
-&gt; CondTree ConfVar [Dependency] a
</span><a href="Distribution.PackageDescription.Parsec.html#mergeCommonStanza"><span class="hs-identifier hs-var hs-var">mergeCommonStanza</span></a></span></span><span> </span><span id="local-6989586621679702136"><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702136"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondNode"><span class="hs-identifier hs-type">CondNode</span></a></span><span> </span><span id="local-6989586621679702135"><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702135"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Dependency]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702134"><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] BuildInfo]
</span><a href="#local-6989586621679702134"><span class="hs-identifier hs-var">bis</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondNode"><span class="hs-identifier hs-type">CondNode</span></a></span><span> </span><span id="local-6989586621679702133"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702133"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Dependency]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702132"><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702132"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-647"></span><span>    </span><span class="annot"><span class="annottext">a
-&gt; [Dependency]
-&gt; [CondBranch ConfVar [Dependency] a]
-&gt; CondTree ConfVar [Dependency] a
forall v c a. a -&gt; c -&gt; [CondBranch v c a] -&gt; CondTree v c a
</span><a href="Distribution.Types.CondTree.html#CondNode"><span class="hs-identifier hs-var">CondNode</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702131"><span class="hs-identifier hs-var">x'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702131"><span class="hs-identifier hs-var">x'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Getting [Dependency] a [Dependency] -&gt; [Dependency]
forall s a. s -&gt; Getting a s a -&gt; a
</span><a href="Distribution.Compat.Lens.html#%5E."><span class="hs-operator hs-var">^.</span></a></span><span> </span><span class="annot"><span class="annottext">Getting [Dependency] a [Dependency]
forall a. HasBuildInfo a =&gt; Lens' a [Dependency]
</span><a href="Distribution.Types.BuildInfo.Lens.html#targetBuildDepends"><span class="hs-identifier hs-var">L.targetBuildDepends</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702129"><span class="hs-identifier hs-var">cs'</span></a></span><span>
</span><span id="line-648"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-649"></span><span>    </span><span class="hs-comment">-- new value is old value with buildInfo field _prepended_.</span><span>
</span><span id="line-650"></span><span>    </span><span id="local-6989586621679702131"><span class="annot"><span class="annottext">x' :: a
</span><a href="#local-6989586621679702131"><span class="hs-identifier hs-var hs-var">x'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702133"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; (a -&gt; a) -&gt; a
forall a b. a -&gt; (a -&gt; b) -&gt; b
</span><a href="Distribution.Compat.Lens.html#%26"><span class="hs-operator hs-var">&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike Identity a a BuildInfo BuildInfo
forall a. HasBuildInfo a =&gt; Lens' a BuildInfo
</span><a href="Distribution.Types.BuildInfo.Lens.html#buildInfo"><span class="hs-identifier hs-var">L.buildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike Identity a a BuildInfo BuildInfo
-&gt; (BuildInfo -&gt; BuildInfo) -&gt; a -&gt; a
forall s t a b. ASetter s t a b -&gt; (a -&gt; b) -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#%25~"><span class="hs-operator hs-var">%~</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679702135"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; BuildInfo -&gt; BuildInfo
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-651"></span><span>
</span><span id="line-652"></span><span>    </span><span class="hs-comment">-- tree components are appended together.</span><span>
</span><span id="line-653"></span><span>    </span><span id="local-6989586621679702129"><span class="annot"><span class="annottext">cs' :: [CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702129"><span class="hs-identifier hs-var hs-var">cs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CondBranch ConfVar [Dependency] BuildInfo
 -&gt; CondBranch ConfVar [Dependency] a)
-&gt; [CondBranch ConfVar [Dependency] BuildInfo]
-&gt; [CondBranch ConfVar [Dependency] a]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(BuildInfo -&gt; a)
-&gt; CondBranch ConfVar [Dependency] BuildInfo
-&gt; CondBranch ConfVar [Dependency] a
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; a
</span><a href="#local-6989586621679702136"><span class="hs-identifier hs-var">fromBuildInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] BuildInfo]
</span><a href="#local-6989586621679702134"><span class="hs-identifier hs-var">bis</span></a></span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
-&gt; [CondBranch ConfVar [Dependency] a]
-&gt; [CondBranch ConfVar [Dependency] a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CondBranch ConfVar [Dependency] a]
</span><a href="#local-6989586621679702132"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-654"></span><span>
</span><span id="line-655"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-656"></span><span class="hs-comment">-- Branches</span><span>
</span><span id="line-657"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-658"></span><span>
</span><span id="line-659"></span><span class="hs-comment">-- Check that a property holds on all branches of a condition tree</span><span>
</span><span id="line-660"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#onAllBranches"><span class="hs-identifier hs-type">onAllBranches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679703608"><span class="annot"><a href="#local-6989586621679703608"><span class="hs-identifier hs-type">v</span></a></span></span><span> </span><span id="local-6989586621679703607"><span class="annot"><a href="#local-6989586621679703607"><span class="hs-identifier hs-type">c</span></a></span></span><span> </span><span id="local-6989586621679703609"><span class="annot"><a href="#local-6989586621679703609"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703609"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679703609"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703608"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703607"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703609"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-661"></span><span id="onAllBranches"><span class="annot"><span class="annottext">onAllBranches :: forall v c a. Monoid a =&gt; (a -&gt; Bool) -&gt; CondTree v c a -&gt; Bool
</span><a href="Distribution.PackageDescription.Parsec.html#onAllBranches"><span class="hs-identifier hs-var hs-var">onAllBranches</span></a></span></span><span> </span><span id="local-6989586621679702118"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679702118"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; CondTree v c a -&gt; Bool
</span><a href="#local-6989586621679702117"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-662"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-663"></span><span>    </span><span class="hs-comment">-- If the current level of the tree satisfies the property, then we are</span><span>
</span><span id="line-664"></span><span>    </span><span class="hs-comment">-- done. If not, then one of the conditional branches below the current node</span><span>
</span><span id="line-665"></span><span>    </span><span class="hs-comment">-- must satisfy it. Each node may have multiple immediate children; we only</span><span>
</span><span id="line-666"></span><span>    </span><span class="hs-comment">-- one need one to satisfy the property because the configure step uses</span><span>
</span><span id="line-667"></span><span>    </span><span class="hs-comment">-- 'mappend' to join together the results of flag resolution.</span><span>
</span><span id="line-668"></span><span>    </span><span class="annot"><a href="#local-6989586621679702117"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679703609"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703608"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703607"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703609"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-669"></span><span>    </span><span id="local-6989586621679702117"><span class="annot"><span class="annottext">go :: a -&gt; CondTree v c a -&gt; Bool
</span><a href="#local-6989586621679702117"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679702116"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702116"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621679702115"><span class="annot"><span class="annottext">CondTree v c a
</span><a href="#local-6989586621679702115"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702113"><span class="annot"><span class="annottext">acc' :: a
</span><a href="#local-6989586621679702113"><span class="hs-identifier hs-var hs-var">acc'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702116"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree v c a -&gt; a
forall v c a. CondTree v c a -&gt; a
</span><a href="Distribution.Types.CondTree.html#condTreeData"><span class="hs-identifier hs-var hs-var">condTreeData</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree v c a
</span><a href="#local-6989586621679702115"><span class="hs-identifier hs-var">ct</span></a></span><span>
</span><span id="line-670"></span><span>                </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679702118"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702113"><span class="hs-identifier hs-var">acc'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">(CondBranch v c a -&gt; Bool) -&gt; [CondBranch v c a] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; CondBranch v c a -&gt; Bool
</span><a href="#local-6989586621679702109"><span class="hs-identifier hs-var">goBranch</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702113"><span class="hs-identifier hs-var">acc'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CondTree v c a -&gt; [CondBranch v c a]
forall v c a. CondTree v c a -&gt; [CondBranch v c a]
</span><a href="Distribution.Types.CondTree.html#condTreeComponents"><span class="hs-identifier hs-var hs-var">condTreeComponents</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree v c a
</span><a href="#local-6989586621679702115"><span class="hs-identifier hs-var">ct</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-671"></span><span>
</span><span id="line-672"></span><span>    </span><span class="hs-comment">-- Both the 'true' and the 'false' block must satisfy the property.</span><span>
</span><span id="line-673"></span><span>    </span><span class="annot"><a href="#local-6989586621679702109"><span class="hs-identifier hs-type">goBranch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679703609"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondBranch"><span class="hs-identifier hs-type">CondBranch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703608"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703607"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703609"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-674"></span><span>    </span><span id="local-6989586621679702109"><span class="annot"><span class="annottext">goBranch :: a -&gt; CondBranch v c a -&gt; Bool
</span><a href="#local-6989586621679702109"><span class="hs-identifier hs-var hs-var">goBranch</span></a></span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondBranch"><span class="hs-identifier hs-type">CondBranch</span></a></span><span> </span><span class="annot"><span class="annottext">Condition v
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CondTree v c a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe (CondTree v c a)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-675"></span><span>    </span><span class="annot"><a href="#local-6989586621679702109"><span class="hs-identifier hs-var">goBranch</span></a></span><span> </span><span id="local-6989586621679702107"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702107"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondBranch"><span class="hs-identifier hs-type">CondBranch</span></a></span><span> </span><span class="annot"><span class="annottext">Condition v
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679702106"><span class="annot"><span class="annottext">CondTree v c a
</span><a href="#local-6989586621679702106"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679702105"><span class="annot"><span class="annottext">CondTree v c a
</span><a href="#local-6989586621679702105"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; CondTree v c a -&gt; Bool
</span><a href="#local-6989586621679702117"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702107"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree v c a
</span><a href="#local-6989586621679702106"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; CondTree v c a -&gt; Bool
</span><a href="#local-6989586621679702117"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679702107"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree v c a
</span><a href="#local-6989586621679702105"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-676"></span><span>
</span><span id="line-677"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-678"></span><span class="hs-comment">-- Post parsing checks</span><span>
</span><span id="line-679"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-680"></span><span>
</span><span id="line-681"></span><span class="hs-comment">-- | Check that we </span><span>
</span><span id="line-682"></span><span class="hs-comment">--</span><span>
</span><span id="line-683"></span><span class="hs-comment">-- * don't use undefined flags (very bad)</span><span>
</span><span id="line-684"></span><span class="hs-comment">-- * define flags which are unused (just bad)</span><span>
</span><span id="line-685"></span><span class="hs-comment">--</span><span>
</span><span id="line-686"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#checkForUndefinedFlags"><span class="hs-identifier hs-type">checkForUndefinedFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-687"></span><span id="checkForUndefinedFlags"><span class="annot"><span class="annottext">checkForUndefinedFlags :: GenericPackageDescription -&gt; ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#checkForUndefinedFlags"><span class="hs-identifier hs-var hs-var">checkForUndefinedFlags</span></a></span></span><span> </span><span id="local-6989586621679702104"><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702104"><span class="hs-identifier hs-var">gpd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-688"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621679702103"><span class="hs-identifier hs-type">definedFlags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679702102"><span class="hs-identifier hs-type">usedFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set.Set</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Flag.html#FlagName"><span class="hs-identifier hs-type">FlagName</span></a></span><span>
</span><span id="line-689"></span><span>        </span><span id="local-6989586621679702103"><span class="annot"><span class="annottext">definedFlags :: Set FlagName
</span><a href="#local-6989586621679702103"><span class="hs-identifier hs-var hs-var">definedFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Getting (Set FlagName) GenericPackageDescription FlagName
-&gt; GenericPackageDescription -&gt; Set FlagName
forall a s. Getting (Set a) s a -&gt; s -&gt; Set a
</span><a href="Distribution.Compat.Lens.html#toSetOf"><span class="hs-identifier hs-var">toSetOf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LensLike
  (Const (Set FlagName))
  GenericPackageDescription
  GenericPackageDescription
  [PackageFlag]
  [PackageFlag]
Lens' GenericPackageDescription [PackageFlag]
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#genPackageFlags"><span class="hs-identifier hs-var">L.genPackageFlags</span></a></span><span> </span><span class="annot"><span class="annottext">LensLike
  (Const (Set FlagName))
  GenericPackageDescription
  GenericPackageDescription
  [PackageFlag]
  [PackageFlag]
-&gt; ((FlagName -&gt; Const (Set FlagName) FlagName)
    -&gt; [PackageFlag] -&gt; Const (Set FlagName) [PackageFlag])
-&gt; Getting (Set FlagName) GenericPackageDescription FlagName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(PackageFlag -&gt; Const (Set FlagName) PackageFlag)
-&gt; [PackageFlag] -&gt; Const (Set FlagName) [PackageFlag]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">((PackageFlag -&gt; Const (Set FlagName) PackageFlag)
 -&gt; [PackageFlag] -&gt; Const (Set FlagName) [PackageFlag])
-&gt; ((FlagName -&gt; Const (Set FlagName) FlagName)
    -&gt; PackageFlag -&gt; Const (Set FlagName) PackageFlag)
-&gt; (FlagName -&gt; Const (Set FlagName) FlagName)
-&gt; [PackageFlag]
-&gt; Const (Set FlagName) [PackageFlag]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(PackageFlag -&gt; FlagName)
-&gt; (FlagName -&gt; Const (Set FlagName) FlagName)
-&gt; PackageFlag
-&gt; Const (Set FlagName) PackageFlag
forall s a r. (s -&gt; a) -&gt; Getting r s a
</span><a href="Distribution.Compat.Lens.html#getting"><span class="hs-identifier hs-var">getting</span></a></span><span> </span><span class="annot"><span class="annottext">PackageFlag -&gt; FlagName
</span><a href="Distribution.Types.Flag.html#flagName"><span class="hs-identifier hs-var hs-var">flagName</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702104"><span class="hs-identifier hs-var">gpd</span></a></span><span>
</span><span id="line-690"></span><span>        </span><span id="local-6989586621679702102"><span class="annot"><span class="annottext">usedFlags :: Set FlagName
</span><a href="#local-6989586621679702102"><span class="hs-identifier hs-var hs-var">usedFlags</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Const (Set FlagName) GenericPackageDescription -&gt; Set FlagName
forall {k} a (b :: k). Const a b -&gt; a
</span><a href="../../base/src/Data.Functor.Const.html#getConst"><span class="hs-identifier hs-var hs-var">getConst</span></a></span><span> </span><span class="annot"><span class="annottext">(Const (Set FlagName) GenericPackageDescription -&gt; Set FlagName)
-&gt; Const (Set FlagName) GenericPackageDescription -&gt; Set FlagName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(forall a.
 CondTree ConfVar [Dependency] a
 -&gt; Const (Set FlagName) (CondTree ConfVar [Dependency] a))
-&gt; GenericPackageDescription
-&gt; Const (Set FlagName) GenericPackageDescription
forall (f :: * -&gt; *).
Applicative f =&gt;
(forall a.
 CondTree ConfVar [Dependency] a
 -&gt; f (CondTree ConfVar [Dependency] a))
-&gt; GenericPackageDescription -&gt; f GenericPackageDescription
</span><a href="Distribution.Types.GenericPackageDescription.Lens.html#allCondTrees"><span class="hs-identifier hs-var">L.allCondTrees</span></a></span><span> </span><span class="annot"><span class="annottext">forall a.
CondTree ConfVar [Dependency] a
-&gt; Const (Set FlagName) (CondTree ConfVar [Dependency] a)
forall c a.
CondTree ConfVar c a -&gt; Const (Set FlagName) (CondTree ConfVar c a)
</span><a href="#local-6989586621679702096"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702104"><span class="hs-identifier hs-var">gpd</span></a></span><span>
</span><span id="line-691"></span><span>
</span><span id="line-692"></span><span>    </span><span class="hs-comment">-- Note: we can check for defined, but unused flags here too.</span><span>
</span><span id="line-693"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; ParseResult () -&gt; ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set FlagName
</span><a href="#local-6989586621679702102"><span class="hs-identifier hs-var">usedFlags</span></a></span><span> </span><span class="annot"><span class="annottext">Set FlagName -&gt; Set FlagName -&gt; Bool
forall a. Ord a =&gt; Set a -&gt; Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#isSubsetOf"><span class="hs-operator hs-var">`Set.isSubsetOf`</span></a></span><span> </span><span class="annot"><span class="annottext">Set FlagName
</span><a href="#local-6989586621679702103"><span class="hs-identifier hs-var">definedFlags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; ParseResult ())
-&gt; ParseResult () -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-694"></span><span>        </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;These flags are used without having been defined: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-695"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; String
forall a. [a] -&gt; [[a]] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;, &quot;</span></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">FlagName -&gt; String
</span><a href="Distribution.Types.Flag.html#unFlagName"><span class="hs-identifier hs-var">unFlagName</span></a></span><span> </span><span class="annot"><span class="annottext">FlagName
</span><a href="#local-6989586621679702093"><span class="hs-identifier hs-var">fn</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679702093"><span class="annot"><span class="annottext">FlagName
</span><a href="#local-6989586621679702093"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Set FlagName -&gt; [FlagName]
forall a. Set a -&gt; [a]
</span><a href="../../containers/src/Data.Set.Internal.html#toList"><span class="hs-identifier hs-var">Set.toList</span></a></span><span> </span><span class="annot"><span class="annottext">(Set FlagName -&gt; [FlagName]) -&gt; Set FlagName -&gt; [FlagName]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Set FlagName
</span><a href="#local-6989586621679702102"><span class="hs-identifier hs-var">usedFlags</span></a></span><span> </span><span class="annot"><span class="annottext">Set FlagName -&gt; Set FlagName -&gt; Set FlagName
forall a. Ord a =&gt; Set a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#difference"><span class="hs-operator hs-var">`Set.difference`</span></a></span><span> </span><span class="annot"><span class="annottext">Set FlagName
</span><a href="#local-6989586621679702103"><span class="hs-identifier hs-var">definedFlags</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-696"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-697"></span><span>    </span><span id="local-6989586621679703520"><span id="local-6989586621679703521"><span class="annot"><a href="#local-6989586621679702096"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703521"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703520"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Const.html#Const"><span class="hs-identifier hs-type">Const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set.Set</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Flag.html#FlagName"><span class="hs-identifier hs-type">FlagName</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.CondTree.html#CondTree"><span class="hs-identifier hs-type">CondTree</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ConfVar.html#ConfVar"><span class="hs-identifier hs-type">ConfVar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703521"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703520"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-698"></span><span>    </span><span id="local-6989586621679702096"><span class="annot"><span class="annottext">f :: forall c a.
CondTree ConfVar c a -&gt; Const (Set FlagName) (CondTree ConfVar c a)
</span><a href="#local-6989586621679702096"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679702089"><span class="annot"><span class="annottext">CondTree ConfVar c a
</span><a href="#local-6989586621679702089"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set FlagName -&gt; Const (Set FlagName) (CondTree ConfVar c a)
forall {k} a (b :: k). a -&gt; Const a b
</span><a href="../../base/src/Data.Functor.Const.html#Const"><span class="hs-identifier hs-var">Const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[FlagName] -&gt; Set FlagName
forall a. Ord a =&gt; [a] -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#fromList"><span class="hs-identifier hs-var">Set.fromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CondTree ConfVar c a -&gt; [FlagName]
forall c a. CondTree ConfVar c a -&gt; [FlagName]
</span><a href="Distribution.PackageDescription.Configuration.html#freeVars"><span class="hs-identifier hs-var">freeVars</span></a></span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar c a
</span><a href="#local-6989586621679702089"><span class="hs-identifier hs-var">ct</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-699"></span><span>
</span><span id="line-700"></span><span class="hs-comment">-- | Since @cabal-version: 1.24@ one can specify @custom-setup@.</span><span>
</span><span id="line-701"></span><span class="hs-comment">-- Let us require it.</span><span>
</span><span id="line-702"></span><span class="hs-comment">--</span><span>
</span><span id="line-703"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#checkForUndefinedCustomSetup"><span class="hs-identifier hs-type">checkForUndefinedCustomSetup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-704"></span><span id="checkForUndefinedCustomSetup"><span class="annot"><span class="annottext">checkForUndefinedCustomSetup :: GenericPackageDescription -&gt; ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#checkForUndefinedCustomSetup"><span class="hs-identifier hs-var hs-var">checkForUndefinedCustomSetup</span></a></span></span><span> </span><span id="local-6989586621679702086"><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702086"><span class="hs-identifier hs-var">gpd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-705"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702085"><span class="annot"><span class="annottext">pd :: PackageDescription
</span><a href="#local-6989586621679702085"><span class="hs-identifier hs-var hs-var">pd</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription -&gt; PackageDescription
</span><a href="Distribution.Types.GenericPackageDescription.html#packageDescription"><span class="hs-identifier hs-var hs-var">packageDescription</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702086"><span class="hs-identifier hs-var">gpd</span></a></span><span>
</span><span id="line-706"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679702083"><span class="annot"><span class="annottext">csv :: CabalSpecVersion
</span><a href="#local-6989586621679702083"><span class="hs-identifier hs-var hs-var">csv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageDescription -&gt; CabalSpecVersion
</span><a href="Distribution.Types.PackageDescription.html#specVersion"><span class="hs-identifier hs-var hs-var">specVersion</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702085"><span class="hs-identifier hs-var">pd</span></a></span><span>
</span><span id="line-707"></span><span>
</span><span id="line-708"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; ParseResult () -&gt; ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription -&gt; BuildType
</span><a href="Distribution.Types.PackageDescription.html#buildType"><span class="hs-identifier hs-var">buildType</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702085"><span class="hs-identifier hs-var">pd</span></a></span><span> </span><span class="annot"><span class="annottext">BuildType -&gt; BuildType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">BuildType
</span><a href="Distribution.Types.BuildType.html#Custom"><span class="hs-identifier hs-var">Custom</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Maybe SetupBuildInfo -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isNothing"><span class="hs-identifier hs-var">isNothing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription -&gt; Maybe SetupBuildInfo
</span><a href="Distribution.Types.PackageDescription.html#setupBuildInfo"><span class="hs-identifier hs-var hs-var">setupBuildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679702085"><span class="hs-identifier hs-var">pd</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; ParseResult ())
-&gt; ParseResult () -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-709"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; ParseResult () -&gt; ParseResult ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702083"><span class="hs-identifier hs-var">csv</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV1_24"><span class="hs-identifier hs-var">CabalSpecV1_24</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ParseResult () -&gt; ParseResult ())
-&gt; ParseResult () -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseFailure"><span class="hs-identifier hs-var">parseFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ParseResult ()) -&gt; String -&gt; ParseResult ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-710"></span><span>            </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Since cabal-version: 1.24 specifying custom-setup section is mandatory&quot;</span></span><span>
</span><span id="line-711"></span><span>
</span><span id="line-712"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-713"></span><span class="hs-comment">-- Post processing of internal dependencies</span><span>
</span><span id="line-714"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-715"></span><span>
</span><span id="line-716"></span><span class="hs-comment">-- Note [Dependencies on sublibraries]</span><span>
</span><span id="line-717"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-718"></span><span class="hs-comment">--</span><span>
</span><span id="line-719"></span><span class="hs-comment">-- This is solution to https://github.com/haskell/cabal/issues/6083</span><span>
</span><span id="line-720"></span><span class="hs-comment">--</span><span>
</span><span id="line-721"></span><span class="hs-comment">-- Before 'cabal-version: 3.0' we didn't have a syntax specially</span><span>
</span><span id="line-722"></span><span class="hs-comment">-- for referring to internal libraries. Internal library names</span><span>
</span><span id="line-723"></span><span class="hs-comment">-- shadowed the outside ones.</span><span>
</span><span id="line-724"></span><span class="hs-comment">--</span><span>
</span><span id="line-725"></span><span class="hs-comment">-- Since 'cabal-version: 3.0' we have ability to write</span><span>
</span><span id="line-726"></span><span class="hs-comment">--</span><span>
</span><span id="line-727"></span><span class="hs-comment">--     build-depends: some-package:its-sub-lib &gt;=1.2.3</span><span>
</span><span id="line-728"></span><span class="hs-comment">--</span><span>
</span><span id="line-729"></span><span class="hs-comment">-- This allows us to refer also to local packages by `this-package:sublib`.</span><span>
</span><span id="line-730"></span><span class="hs-comment">-- So since 'cabal-version: 3.4' to refer to *any*</span><span>
</span><span id="line-731"></span><span class="hs-comment">-- sublibrary we must use the two part syntax. Here's small table:</span><span>
</span><span id="line-732"></span><span class="hs-comment">--</span><span>
</span><span id="line-733"></span><span class="hs-comment">--                   | pre-3.4             |      3.4 and after            |</span><span>
</span><span id="line-734"></span><span class="hs-comment">-- ------------------|---------------------|-------------------------------|</span><span>
</span><span id="line-735"></span><span class="hs-comment">-- pkg-name          | may refer to sublib | always refers to external pkg |</span><span>
</span><span id="line-736"></span><span class="hs-comment">-- pkg-name:sublib   | refers to sublib    | refers to sublib              |</span><span>
</span><span id="line-737"></span><span class="hs-comment">-- pkg-name:pkg-name | may refer to sublib | always refers to external pkg |</span><span>
</span><span id="line-738"></span><span class="hs-comment">--</span><span>
</span><span id="line-739"></span><span class="hs-comment">-- In pre-3.4 case, if a package 'this-pkg' has a sublibrary 'pkg-name',</span><span>
</span><span id="line-740"></span><span class="hs-comment">-- all dependency definitions will refer to that sublirary.</span><span>
</span><span id="line-741"></span><span class="hs-comment">--</span><span>
</span><span id="line-742"></span><span class="hs-comment">-- In 3.4 and after case, 'pkg-name' will always refer to external package,</span><span>
</span><span id="line-743"></span><span class="hs-comment">-- and to use internal library you have to say 'this-pkg:pkg-name'.</span><span>
</span><span id="line-744"></span><span class="hs-comment">--</span><span>
</span><span id="line-745"></span><span class="hs-comment">-- In summary, In 3.4 and after, the internal names don't shadow,</span><span>
</span><span id="line-746"></span><span class="hs-comment">-- as there is an explicit syntax to refer to them,</span><span>
</span><span id="line-747"></span><span class="hs-comment">-- i.e. what you write is what you get;</span><span>
</span><span id="line-748"></span><span class="hs-comment">-- For pre-3.4 we post-process the file.</span><span>
</span><span id="line-749"></span><span class="hs-comment">--</span><span>
</span><span id="line-750"></span><span class="hs-comment">-- Similarly, we process mixins.</span><span>
</span><span id="line-751"></span><span class="hs-comment">-- See https://github.com/haskell/cabal/issues/6281</span><span>
</span><span id="line-752"></span><span class="hs-comment">--</span><span>
</span><span id="line-753"></span><span>
</span><span id="line-754"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#postProcessInternalDeps"><span class="hs-identifier hs-type">postProcessInternalDeps</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html#CabalSpecVersion"><span class="hs-identifier hs-type">CabalSpecVersion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.GenericPackageDescription.html#GenericPackageDescription"><span class="hs-identifier hs-type">GenericPackageDescription</span></a></span><span>
</span><span id="line-755"></span><span id="postProcessInternalDeps"><span class="annot"><span class="annottext">postProcessInternalDeps :: CabalSpecVersion
-&gt; GenericPackageDescription -&gt; GenericPackageDescription
</span><a href="Distribution.PackageDescription.Parsec.html#postProcessInternalDeps"><span class="hs-identifier hs-var hs-var">postProcessInternalDeps</span></a></span></span><span> </span><span id="local-6989586621679702078"><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702078"><span class="hs-identifier hs-var">specVer</span></a></span></span><span> </span><span id="local-6989586621679702077"><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702077"><span class="hs-identifier hs-var">gpd</span></a></span></span><span>
</span><span id="line-756"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="#local-6989586621679702078"><span class="hs-identifier hs-var">specVer</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion -&gt; CabalSpecVersion -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#CabalSpecV3_4"><span class="hs-identifier hs-var">CabalSpecV3_4</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702077"><span class="hs-identifier hs-var">gpd</span></a></span><span>
</span><span id="line-757"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(BuildInfo -&gt; BuildInfo)
-&gt; (SetupBuildInfo -&gt; SetupBuildInfo)
-&gt; GenericPackageDescription
-&gt; GenericPackageDescription
</span><a href="Distribution.PackageDescription.Configuration.html#transformAllBuildInfos"><span class="hs-identifier hs-var">transformAllBuildInfos</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; BuildInfo
</span><a href="#local-6989586621679702075"><span class="hs-identifier hs-var">transformBI</span></a></span><span> </span><span class="annot"><span class="annottext">SetupBuildInfo -&gt; SetupBuildInfo
</span><a href="#local-6989586621679702074"><span class="hs-identifier hs-var">transformSBI</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702077"><span class="hs-identifier hs-var">gpd</span></a></span><span>
</span><span id="line-758"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-759"></span><span>    </span><span class="annot"><a href="#local-6989586621679702075"><span class="hs-identifier hs-type">transformBI</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span>
</span><span id="line-760"></span><span>    </span><span id="local-6989586621679702075"><span class="annot"><span class="annottext">transformBI :: BuildInfo -&gt; BuildInfo
</span><a href="#local-6989586621679702075"><span class="hs-identifier hs-var hs-var">transformBI</span></a></span></span><span>
</span><span id="line-761"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ASetter BuildInfo BuildInfo [Dependency] [Dependency]
-&gt; ([Dependency] -&gt; [Dependency]) -&gt; BuildInfo -&gt; BuildInfo
forall s t a b. ASetter s t a b -&gt; (a -&gt; b) -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#over"><span class="hs-identifier hs-var">over</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter BuildInfo BuildInfo [Dependency] [Dependency]
forall a. HasBuildInfo a =&gt; Lens' a [Dependency]
</span><a href="Distribution.Types.BuildInfo.Lens.html#targetBuildDepends"><span class="hs-identifier hs-var">L.targetBuildDepends</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Dependency -&gt; [Dependency]) -&gt; [Dependency] -&gt; [Dependency]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">Dependency -&gt; [Dependency]
</span><a href="#local-6989586621679702071"><span class="hs-identifier hs-var">transformD</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-762"></span><span>        </span><span class="annot"><span class="annottext">(BuildInfo -&gt; BuildInfo)
-&gt; (BuildInfo -&gt; BuildInfo) -&gt; BuildInfo -&gt; BuildInfo
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter BuildInfo BuildInfo [Mixin] [Mixin]
-&gt; ([Mixin] -&gt; [Mixin]) -&gt; BuildInfo -&gt; BuildInfo
forall s t a b. ASetter s t a b -&gt; (a -&gt; b) -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#over"><span class="hs-identifier hs-var">over</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter BuildInfo BuildInfo [Mixin] [Mixin]
forall a. HasBuildInfo a =&gt; Lens' a [Mixin]
</span><a href="Distribution.Types.BuildInfo.Lens.html#mixins"><span class="hs-identifier hs-var">L.mixins</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Mixin -&gt; Mixin) -&gt; [Mixin] -&gt; [Mixin]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Mixin -&gt; Mixin
</span><a href="#local-6989586621679702069"><span class="hs-identifier hs-var">transformM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-763"></span><span>
</span><span id="line-764"></span><span>    </span><span class="annot"><a href="#local-6989586621679702074"><span class="hs-identifier hs-type">transformSBI</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.SetupBuildInfo.html#SetupBuildInfo"><span class="hs-identifier hs-type">SetupBuildInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.SetupBuildInfo.html#SetupBuildInfo"><span class="hs-identifier hs-type">SetupBuildInfo</span></a></span><span>
</span><span id="line-765"></span><span>    </span><span id="local-6989586621679702074"><span class="annot"><span class="annottext">transformSBI :: SetupBuildInfo -&gt; SetupBuildInfo
</span><a href="#local-6989586621679702074"><span class="hs-identifier hs-var hs-var">transformSBI</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ASetter SetupBuildInfo SetupBuildInfo [Dependency] [Dependency]
-&gt; ([Dependency] -&gt; [Dependency])
-&gt; SetupBuildInfo
-&gt; SetupBuildInfo
forall s t a b. ASetter s t a b -&gt; (a -&gt; b) -&gt; s -&gt; t
</span><a href="Distribution.Compat.Lens.html#over"><span class="hs-identifier hs-var">over</span></a></span><span> </span><span class="annot"><span class="annottext">ASetter SetupBuildInfo SetupBuildInfo [Dependency] [Dependency]
Lens' SetupBuildInfo [Dependency]
</span><a href="Distribution.Types.SetupBuildInfo.Lens.html#setupDepends"><span class="hs-identifier hs-var">L.setupDepends</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Dependency -&gt; [Dependency]) -&gt; [Dependency] -&gt; [Dependency]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">Dependency -&gt; [Dependency]
</span><a href="#local-6989586621679702071"><span class="hs-identifier hs-var">transformD</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-766"></span><span>
</span><span id="line-767"></span><span>    </span><span class="annot"><a href="#local-6989586621679702071"><span class="hs-identifier hs-type">transformD</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-768"></span><span>    </span><span id="local-6989586621679702071"><span class="annot"><span class="annottext">transformD :: Dependency -&gt; [Dependency]
</span><a href="#local-6989586621679702071"><span class="hs-identifier hs-var hs-var">transformD</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-type">Dependency</span></a></span><span> </span><span id="local-6989586621679702066"><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621679702066"><span class="hs-identifier hs-var">pn</span></a></span></span><span> </span><span id="local-6989586621679702065"><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679702065"><span class="hs-identifier hs-var">vr</span></a></span></span><span> </span><span id="local-6989586621679702064"><span class="annot"><span class="annottext">NonEmptySet LibraryName
</span><a href="#local-6989586621679702064"><span class="hs-identifier hs-var">ln</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-769"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702063"><span class="hs-identifier hs-var">uqn</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName -&gt; Set UnqualComponentName -&gt; Bool
forall a. Ord a =&gt; a -&gt; Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#member"><span class="hs-operator hs-var">`Set.member`</span></a></span><span> </span><span class="annot"><span class="annottext">Set UnqualComponentName
</span><a href="#local-6989586621679702061"><span class="hs-identifier hs-var">internalLibs</span></a></span><span>
</span><span id="line-770"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="Distribution.Types.LibraryName.html#LMainLibName"><span class="hs-identifier hs-var">LMainLibName</span></a></span><span> </span><span class="annot"><span class="annottext">LibraryName -&gt; NonEmptySet LibraryName -&gt; Bool
forall a. Ord a =&gt; a -&gt; NonEmptySet a -&gt; Bool
</span><a href="Distribution.Compat.NonEmptySet.html#member"><span class="hs-operator hs-var">`NES.member`</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmptySet LibraryName
</span><a href="#local-6989586621679702064"><span class="hs-identifier hs-var">ln</span></a></span><span>
</span><span id="line-771"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LibraryName
-&gt; NonEmptySet LibraryName -&gt; Maybe (NonEmptySet LibraryName)
forall a. Ord a =&gt; a -&gt; NonEmptySet a -&gt; Maybe (NonEmptySet a)
</span><a href="Distribution.Compat.NonEmptySet.html#delete"><span class="hs-identifier hs-var">NES.delete</span></a></span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="Distribution.Types.LibraryName.html#LMainLibName"><span class="hs-identifier hs-var">LMainLibName</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmptySet LibraryName
</span><a href="#local-6989586621679702064"><span class="hs-identifier hs-var">ln</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-772"></span><span>            </span><span class="annot"><span class="annottext">Maybe (NonEmptySet LibraryName)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Dependency
</span><a href="#local-6989586621679702058"><span class="hs-identifier hs-var">dep</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-773"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679702057"><span class="annot"><span class="annottext">NonEmptySet LibraryName
</span><a href="#local-6989586621679702057"><span class="hs-identifier hs-var">ln'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Dependency
</span><a href="#local-6989586621679702058"><span class="hs-identifier hs-var">dep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">PackageName
-&gt; VersionRange -&gt; NonEmptySet LibraryName -&gt; Dependency
</span><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-var">Dependency</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621679702066"><span class="hs-identifier hs-var">pn</span></a></span><span> </span><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679702065"><span class="hs-identifier hs-var">vr</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmptySet LibraryName
</span><a href="#local-6989586621679702057"><span class="hs-identifier hs-var">ln'</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-774"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-775"></span><span>        </span><span id="local-6989586621679702063"><span class="annot"><span class="annottext">uqn :: UnqualComponentName
</span><a href="#local-6989586621679702063"><span class="hs-identifier hs-var hs-var">uqn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; UnqualComponentName
</span><a href="Distribution.Types.UnqualComponentName.html#packageNameToUnqualComponentName"><span class="hs-identifier hs-var">packageNameToUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621679702066"><span class="hs-identifier hs-var">pn</span></a></span><span>
</span><span id="line-776"></span><span>        </span><span id="local-6989586621679702058"><span class="annot"><span class="annottext">dep :: Dependency
</span><a href="#local-6989586621679702058"><span class="hs-identifier hs-var hs-var">dep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageName
-&gt; VersionRange -&gt; NonEmptySet LibraryName -&gt; Dependency
</span><a href="Distribution.Types.Dependency.html#Dependency"><span class="hs-identifier hs-var">Dependency</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621679702055"><span class="hs-identifier hs-var">thisPn</span></a></span><span> </span><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679702065"><span class="hs-identifier hs-var">vr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LibraryName -&gt; NonEmptySet LibraryName
forall a. a -&gt; NonEmptySet a
</span><a href="Distribution.Compat.NonEmptySet.html#singleton"><span class="hs-identifier hs-var">NES.singleton</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; LibraryName
</span><a href="Distribution.Types.LibraryName.html#LSubLibName"><span class="hs-identifier hs-var">LSubLibName</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702063"><span class="hs-identifier hs-var">uqn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-777"></span><span>
</span><span id="line-778"></span><span>    </span><span class="annot"><a href="#local-6989586621679702071"><span class="hs-identifier hs-var">transformD</span></a></span><span> </span><span id="local-6989586621679702053"><span class="annot"><span class="annottext">Dependency
</span><a href="#local-6989586621679702053"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Dependency
</span><a href="#local-6989586621679702053"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-779"></span><span>
</span><span id="line-780"></span><span>    </span><span class="annot"><a href="#local-6989586621679702069"><span class="hs-identifier hs-type">transformM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.Mixin.html#Mixin"><span class="hs-identifier hs-type">Mixin</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.Mixin.html#Mixin"><span class="hs-identifier hs-type">Mixin</span></a></span><span>
</span><span id="line-781"></span><span>    </span><span id="local-6989586621679702069"><span class="annot"><span class="annottext">transformM :: Mixin -&gt; Mixin
</span><a href="#local-6989586621679702069"><span class="hs-identifier hs-var hs-var">transformM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.Mixin.html#Mixin"><span class="hs-identifier hs-type">Mixin</span></a></span><span> </span><span id="local-6989586621679702051"><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621679702051"><span class="hs-identifier hs-var">pn</span></a></span></span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="Distribution.Types.LibraryName.html#LMainLibName"><span class="hs-identifier hs-var">LMainLibName</span></a></span><span> </span><span id="local-6989586621679702050"><span class="annot"><span class="annottext">IncludeRenaming
</span><a href="#local-6989586621679702050"><span class="hs-identifier hs-var">incl</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-782"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702049"><span class="hs-identifier hs-var">uqn</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName -&gt; Set UnqualComponentName -&gt; Bool
forall a. Ord a =&gt; a -&gt; Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#member"><span class="hs-operator hs-var">`Set.member`</span></a></span><span> </span><span class="annot"><span class="annottext">Set UnqualComponentName
</span><a href="#local-6989586621679702061"><span class="hs-identifier hs-var">internalLibs</span></a></span><span>
</span><span id="line-783"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; LibraryName -&gt; IncludeRenaming -&gt; Mixin
</span><a href="Distribution.Types.Mixin.html#mkMixin"><span class="hs-identifier hs-var">mkMixin</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621679702055"><span class="hs-identifier hs-var">thisPn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName -&gt; LibraryName
</span><a href="Distribution.Types.LibraryName.html#LSubLibName"><span class="hs-identifier hs-var">LSubLibName</span></a></span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702049"><span class="hs-identifier hs-var">uqn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IncludeRenaming
</span><a href="#local-6989586621679702050"><span class="hs-identifier hs-var">incl</span></a></span><span>
</span><span id="line-784"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-785"></span><span>        </span><span id="local-6989586621679702049"><span class="annot"><span class="annottext">uqn :: UnqualComponentName
</span><a href="#local-6989586621679702049"><span class="hs-identifier hs-var hs-var">uqn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; UnqualComponentName
</span><a href="Distribution.Types.UnqualComponentName.html#packageNameToUnqualComponentName"><span class="hs-identifier hs-var">packageNameToUnqualComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621679702051"><span class="hs-identifier hs-var">pn</span></a></span><span>
</span><span id="line-786"></span><span>
</span><span id="line-787"></span><span>    </span><span class="annot"><a href="#local-6989586621679702069"><span class="hs-identifier hs-var">transformM</span></a></span><span> </span><span id="local-6989586621679702048"><span class="annot"><span class="annottext">Mixin
</span><a href="#local-6989586621679702048"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mixin
</span><a href="#local-6989586621679702048"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-788"></span><span>
</span><span id="line-789"></span><span>    </span><span class="annot"><a href="#local-6989586621679702055"><span class="hs-identifier hs-type">thisPn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.PackageName.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span>
</span><span id="line-790"></span><span>    </span><span id="local-6989586621679702055"><span class="annot"><span class="annottext">thisPn :: PackageName
</span><a href="#local-6989586621679702055"><span class="hs-identifier hs-var hs-var">thisPn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageIdentifier -&gt; PackageName
</span><a href="Distribution.Types.PackageId.html#pkgName"><span class="hs-identifier hs-var hs-var">pkgName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageDescription -&gt; PackageIdentifier
</span><a href="Distribution.Types.PackageDescription.html#package"><span class="hs-identifier hs-var hs-var">package</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericPackageDescription -&gt; PackageDescription
</span><a href="Distribution.Types.GenericPackageDescription.html#packageDescription"><span class="hs-identifier hs-var hs-var">packageDescription</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702077"><span class="hs-identifier hs-var">gpd</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-791"></span><span>
</span><span id="line-792"></span><span>    </span><span class="annot"><a href="#local-6989586621679702061"><span class="hs-identifier hs-type">internalLibs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnqualComponentName.html#UnqualComponentName"><span class="hs-identifier hs-type">UnqualComponentName</span></a></span><span>
</span><span id="line-793"></span><span>    </span><span id="local-6989586621679702061"><span class="annot"><span class="annottext">internalLibs :: Set UnqualComponentName
</span><a href="#local-6989586621679702061"><span class="hs-identifier hs-var hs-var">internalLibs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[UnqualComponentName] -&gt; Set UnqualComponentName
forall a. Ord a =&gt; [a] -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#fromList"><span class="hs-identifier hs-var">Set.fromList</span></a></span><span>
</span><span id="line-794"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702045"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-795"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679702045"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679702045"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CondTree ConfVar [Dependency] Library
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
-&gt; [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
</span><a href="Distribution.Types.GenericPackageDescription.html#condSubLibraries"><span class="hs-identifier hs-var hs-var">condSubLibraries</span></a></span><span> </span><span class="annot"><span class="annottext">GenericPackageDescription
</span><a href="#local-6989586621679702077"><span class="hs-identifier hs-var">gpd</span></a></span><span>
</span><span id="line-796"></span><span>        </span><span class="hs-special">]</span><span>
</span><span id="line-797"></span><span>
</span><span id="line-798"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-799"></span><span class="hs-comment">-- Old syntax</span><span>
</span><span id="line-800"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-801"></span><span>
</span><span id="line-802"></span><span class="hs-comment">-- TODO: move to own module</span><span>
</span><span id="line-803"></span><span>
</span><span id="line-804"></span><span class="hs-comment">-- | &quot;Sectionize&quot; an old-style Cabal file.  A sectionized file has:</span><span>
</span><span id="line-805"></span><span class="hs-comment">--</span><span>
</span><span id="line-806"></span><span class="hs-comment">--  * all global fields at the beginning, followed by</span><span>
</span><span id="line-807"></span><span class="hs-comment">--</span><span>
</span><span id="line-808"></span><span class="hs-comment">--  * all flag declarations, followed by</span><span>
</span><span id="line-809"></span><span class="hs-comment">--</span><span>
</span><span id="line-810"></span><span class="hs-comment">--  * an optional library section, and an arbitrary number of executable</span><span>
</span><span id="line-811"></span><span class="hs-comment">--    sections (in any order).</span><span>
</span><span id="line-812"></span><span class="hs-comment">--</span><span>
</span><span id="line-813"></span><span class="hs-comment">-- The current implementation just gathers all library-specific fields</span><span>
</span><span id="line-814"></span><span class="hs-comment">-- in a library section and wraps all executable stanzas in an executable</span><span>
</span><span id="line-815"></span><span class="hs-comment">-- section.</span><span>
</span><span id="line-816"></span><span id="local-6989586621679703693"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#sectionizeFields"><span class="hs-identifier hs-type">sectionizeFields</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703693"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#Syntax"><span class="hs-identifier hs-type">Syntax</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703693"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-817"></span><span id="sectionizeFields"><span class="annot"><span class="annottext">sectionizeFields :: forall ann. [Field ann] -&gt; (Syntax, [Field ann])
</span><a href="Distribution.PackageDescription.Parsec.html#sectionizeFields"><span class="hs-identifier hs-var hs-var">sectionizeFields</span></a></span></span><span> </span><span id="local-6989586621679702043"><span class="annot"><span class="annottext">[Field ann]
</span><a href="#local-6989586621679702043"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Field ann] -&gt; Maybe [(Name ann, [FieldLine ann])]
forall ann. [Field ann] -&gt; Maybe [(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702042"><span class="hs-identifier hs-var">classifyFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field ann]
</span><a href="#local-6989586621679702043"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-818"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679702041"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702041"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Syntax
</span><a href="Distribution.PackageDescription.Parsec.html#OldSyntax"><span class="hs-identifier hs-var">OldSyntax</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])] -&gt; [Field ann]
forall ann. [(Name ann, [FieldLine ann])] -&gt; [Field ann]
</span><a href="#local-6989586621679702040"><span class="hs-identifier hs-var">convert</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702041"><span class="hs-identifier hs-var">fields</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-819"></span><span>    </span><span class="annot"><span class="annottext">Maybe [(Name ann, [FieldLine ann])]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Syntax
</span><a href="Distribution.PackageDescription.Parsec.html#NewSyntax"><span class="hs-identifier hs-var">NewSyntax</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Field ann]
</span><a href="#local-6989586621679702043"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-820"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-821"></span><span>    </span><span class="hs-comment">-- return 'Just' if all fields are simple fields</span><span>
</span><span id="line-822"></span><span>    </span><span id="local-6989586621679703498"><span class="annot"><a href="#local-6989586621679702042"><span class="hs-identifier hs-type">classifyFields</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703498"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703498"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-type">FieldLine</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703498"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-823"></span><span>    </span><span id="local-6989586621679702042"><span class="annot"><span class="annottext">classifyFields :: forall ann. [Field ann] -&gt; Maybe [(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702042"><span class="hs-identifier hs-var hs-var">classifyFields</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Field ann -&gt; Maybe (Name ann, [FieldLine ann]))
-&gt; [Field ann] -&gt; Maybe [(Name ann, [FieldLine ann])]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">Field ann -&gt; Maybe (Name ann, [FieldLine ann])
forall {ann}. Field ann -&gt; Maybe (Name ann, [FieldLine ann])
</span><a href="#local-6989586621679702037"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-824"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-825"></span><span>        </span><span id="local-6989586621679702037"><span class="annot"><span class="annottext">f :: Field ann -&gt; Maybe (Name ann, [FieldLine ann])
</span><a href="#local-6989586621679702037"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span id="local-6989586621679702036"><span class="annot"><span class="annottext">Name ann
</span><a href="#local-6989586621679702036"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679702035"><span class="annot"><span class="annottext">[FieldLine ann]
</span><a href="#local-6989586621679702035"><span class="hs-identifier hs-var">fieldlines</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name ann, [FieldLine ann]) -&gt; Maybe (Name ann, [FieldLine ann])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name ann
</span><a href="#local-6989586621679702036"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[FieldLine ann]
</span><a href="#local-6989586621679702035"><span class="hs-identifier hs-var">fieldlines</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-826"></span><span>        </span><span class="annot"><a href="#local-6989586621679702037"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Field ann
</span><span class="hs-identifier">_</span></span><span>                      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Name ann, [FieldLine ann])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-827"></span><span>
</span><span id="line-828"></span><span>    </span><span id="local-6989586621679702034"><span class="annot"><span class="annottext">trim :: ByteString -&gt; ByteString
</span><a href="#local-6989586621679702034"><span class="hs-identifier hs-var hs-var">trim</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#dropWhile"><span class="hs-identifier hs-var">BS.dropWhile</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Bool
</span><a href="#local-6989586621679702032"><span class="hs-identifier hs-var">isSpace'</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString)
-&gt; (ByteString -&gt; ByteString) -&gt; ByteString -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#reverse"><span class="hs-identifier hs-var">BS.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString)
-&gt; (ByteString -&gt; ByteString) -&gt; ByteString -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#dropWhile"><span class="hs-identifier hs-var">BS.dropWhile</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Bool
</span><a href="#local-6989586621679702032"><span class="hs-identifier hs-var">isSpace'</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString)
-&gt; (ByteString -&gt; ByteString) -&gt; ByteString -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#reverse"><span class="hs-identifier hs-var">BS.reverse</span></a></span><span>
</span><span id="line-829"></span><span>    </span><span id="local-6989586621679702032"><span class="annot"><span class="annottext">isSpace' :: Word8 -&gt; Bool
</span><a href="#local-6989586621679702032"><span class="hs-identifier hs-var hs-var">isSpace'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">32</span></span><span class="hs-special">)</span><span>
</span><span id="line-830"></span><span>
</span><span id="line-831"></span><span>    </span><span id="local-6989586621679703497"><span class="annot"><a href="#local-6989586621679702040"><span class="hs-identifier hs-type">convert</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703497"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-type">FieldLine</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703497"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679703497"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-832"></span><span>    </span><span id="local-6989586621679702040"><span class="annot"><span class="annottext">convert :: forall ann. [(Name ann, [FieldLine ann])] -&gt; [Field ann]
</span><a href="#local-6989586621679702040"><span class="hs-identifier hs-var hs-var">convert</span></a></span></span><span> </span><span id="local-6989586621679702027"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702027"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-833"></span><span>      </span><span class="hs-keyword">let</span><span>
</span><span id="line-834"></span><span>        </span><span id="local-6989586621679702026"><span class="annot"><span class="annottext">toField :: (Name ann, [FieldLine ann]) -&gt; Field ann
</span><a href="#local-6989586621679702026"><span class="hs-identifier hs-var hs-var">toField</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679702025"><span class="annot"><span class="annottext">Name ann
</span><a href="#local-6989586621679702025"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702024"><span class="annot"><span class="annottext">[FieldLine ann]
</span><a href="#local-6989586621679702024"><span class="hs-identifier hs-var">ls</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name ann -&gt; [FieldLine ann] -&gt; Field ann
forall ann. Name ann -&gt; [FieldLine ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-var">Field</span></a></span><span> </span><span class="annot"><span class="annottext">Name ann
</span><a href="#local-6989586621679702025"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine ann]
</span><a href="#local-6989586621679702024"><span class="hs-identifier hs-var">ls</span></a></span><span>
</span><span id="line-835"></span><span>        </span><span class="hs-comment">-- &quot;build-depends&quot; is a local field now.  To be backwards</span><span>
</span><span id="line-836"></span><span>        </span><span class="hs-comment">-- compatible, we still allow it as a global field in old-style</span><span>
</span><span id="line-837"></span><span>        </span><span class="hs-comment">-- package description files and translate it to a local field by</span><span>
</span><span id="line-838"></span><span>        </span><span class="hs-comment">-- adding it to every non-empty section</span><span>
</span><span id="line-839"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679702021"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702021"><span class="hs-identifier hs-var">hdr0</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702020"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702020"><span class="hs-identifier hs-var">exes0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Name ann, [FieldLine ann]) -&gt; Bool)
-&gt; [(Name ann, [FieldLine ann])]
-&gt; ([(Name ann, [FieldLine ann])], [(Name ann, [FieldLine ann])])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#break"><span class="hs-identifier hs-var">break</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;executable&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Bool)
-&gt; ((Name ann, [FieldLine ann]) -&gt; ByteString)
-&gt; (Name ann, [FieldLine ann])
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name ann -&gt; ByteString
forall ann. Name ann -&gt; ByteString
</span><a href="Distribution.Fields.Field.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann -&gt; ByteString)
-&gt; ((Name ann, [FieldLine ann]) -&gt; Name ann)
-&gt; (Name ann, [FieldLine ann])
-&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann, [FieldLine ann]) -&gt; Name ann
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702027"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-840"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679702016"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702016"><span class="hs-identifier hs-var">hdr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702015"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702015"><span class="hs-identifier hs-var">libfs0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Name ann, [FieldLine ann]) -&gt; Bool)
-&gt; [(Name ann, [FieldLine ann])]
-&gt; ([(Name ann, [FieldLine ann])], [(Name ann, [FieldLine ann])])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool)
-&gt; ((Name ann, [FieldLine ann]) -&gt; Bool)
-&gt; (Name ann, [FieldLine ann])
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="Distribution.PackageDescription.Parsec.html#libFieldNames"><span class="hs-identifier hs-var">libFieldNames</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Bool)
-&gt; ((Name ann, [FieldLine ann]) -&gt; ByteString)
-&gt; (Name ann, [FieldLine ann])
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name ann -&gt; ByteString
forall ann. Name ann -&gt; ByteString
</span><a href="Distribution.Fields.Field.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann -&gt; ByteString)
-&gt; ((Name ann, [FieldLine ann]) -&gt; Name ann)
-&gt; (Name ann, [FieldLine ann])
-&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann, [FieldLine ann]) -&gt; Name ann
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702021"><span class="hs-identifier hs-var">hdr0</span></a></span><span>
</span><span id="line-841"></span><span>
</span><span id="line-842"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679702008"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702008"><span class="hs-identifier hs-var">deps</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679702007"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702007"><span class="hs-identifier hs-var">libfs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Name ann, [FieldLine ann]) -&gt; Bool)
-&gt; [(Name ann, [FieldLine ann])]
-&gt; ([(Name ann, [FieldLine ann])], [(Name ann, [FieldLine ann])])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;build-depends&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Bool)
-&gt; ((Name ann, [FieldLine ann]) -&gt; ByteString)
-&gt; (Name ann, [FieldLine ann])
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name ann -&gt; ByteString
forall ann. Name ann -&gt; ByteString
</span><a href="Distribution.Fields.Field.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann -&gt; ByteString)
-&gt; ((Name ann, [FieldLine ann]) -&gt; Name ann)
-&gt; (Name ann, [FieldLine ann])
-&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann, [FieldLine ann]) -&gt; Name ann
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-843"></span><span>                                   </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702015"><span class="hs-identifier hs-var">libfs0</span></a></span><span>
</span><span id="line-844"></span><span>
</span><span id="line-845"></span><span>        </span><span id="local-6989586621679702006"><span class="annot"><span class="annottext">exes :: [Field ann]
</span><a href="#local-6989586621679702006"><span class="hs-identifier hs-var hs-var">exes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([(Name ann, [FieldLine ann])]
 -&gt; Maybe (Field ann, [(Name ann, [FieldLine ann])]))
-&gt; [(Name ann, [FieldLine ann])] -&gt; [Field ann]
forall b a. (b -&gt; Maybe (a, b)) -&gt; b -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#unfoldr"><span class="hs-identifier hs-var">unfoldr</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
-&gt; Maybe (Field ann, [(Name ann, [FieldLine ann])])
</span><a href="#local-6989586621679702004"><span class="hs-identifier hs-var">toExe</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702020"><span class="hs-identifier hs-var">exes0</span></a></span><span>
</span><span id="line-846"></span><span>        </span><span id="local-6989586621679702004"><span class="annot"><span class="annottext">toExe :: [(Name ann, [FieldLine ann])]
-&gt; Maybe (Field ann, [(Name ann, [FieldLine ann])])
</span><a href="#local-6989586621679702004"><span class="hs-identifier hs-var hs-var">toExe</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Field ann, [(Name ann, [FieldLine ann])])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-847"></span><span>        </span><span class="annot"><a href="#local-6989586621679702004"><span class="hs-identifier hs-var">toExe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679701998"><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679701998"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621679701997"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701997"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701996"><span class="annot"><span class="annottext">[FieldLine ann]
</span><a href="#local-6989586621679701996"><span class="hs-identifier hs-var">ls</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621679701995"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679701995"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-848"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701997"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;executable&quot;</span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-849"></span><span>              </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679701992"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679701992"><span class="hs-identifier hs-var">efs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701991"><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679701991"><span class="hs-identifier hs-var">r'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Name ann, [FieldLine ann]) -&gt; Bool)
-&gt; [(Name ann, [FieldLine ann])]
-&gt; ([(Name ann, [FieldLine ann])], [(Name ann, [FieldLine ann])])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#break"><span class="hs-identifier hs-var">break</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;executable&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Bool)
-&gt; ((Name ann, [FieldLine ann]) -&gt; ByteString)
-&gt; (Name ann, [FieldLine ann])
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name ann -&gt; ByteString
forall ann. Name ann -&gt; ByteString
</span><a href="Distribution.Fields.Field.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann -&gt; ByteString)
-&gt; ((Name ann, [FieldLine ann]) -&gt; Name ann)
-&gt; (Name ann, [FieldLine ann])
-&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann, [FieldLine ann]) -&gt; Name ann
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679701995"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-850"></span><span>              </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">(Field ann, [(Name ann, [FieldLine ann])])
-&gt; Maybe (Field ann, [(Name ann, [FieldLine ann])])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name ann -&gt; [SectionArg ann] -&gt; [Field ann] -&gt; Field ann
forall ann.
Name ann -&gt; [SectionArg ann] -&gt; [Field ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Section"><span class="hs-identifier hs-var">Section</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ann -&gt; ByteString -&gt; Name ann
forall ann. ann -&gt; ByteString -&gt; Name ann
</span><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-var">Name</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679701998"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;executable&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ann -&gt; ByteString -&gt; SectionArg ann
forall ann. ann -&gt; ByteString -&gt; SectionArg ann
</span><a href="Distribution.Fields.Field.html#SecArgName"><span class="hs-identifier hs-var">SecArgName</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679701998"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; SectionArg ann) -&gt; ByteString -&gt; SectionArg ann
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString
</span><a href="#local-6989586621679702034"><span class="hs-identifier hs-var">trim</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString) -&gt; ByteString -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine ann] -&gt; ByteString
forall ann. [FieldLine ann] -&gt; ByteString
</span><a href="Distribution.PackageDescription.Parsec.html#fieldlinesToBS"><span class="hs-identifier hs-var">fieldlinesToBS</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine ann]
</span><a href="#local-6989586621679701996"><span class="hs-identifier hs-var">ls</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Name ann, [FieldLine ann]) -&gt; Field ann)
-&gt; [(Name ann, [FieldLine ann])] -&gt; [Field ann]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann, [FieldLine ann]) -&gt; Field ann
forall {ann}. (Name ann, [FieldLine ann]) -&gt; Field ann
</span><a href="#local-6989586621679702026"><span class="hs-identifier hs-var">toField</span></a></span><span> </span><span class="annot"><span class="annottext">([(Name ann, [FieldLine ann])] -&gt; [Field ann])
-&gt; [(Name ann, [FieldLine ann])] -&gt; [Field ann]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702008"><span class="hs-identifier hs-var">deps</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
-&gt; [(Name ann, [FieldLine ann])] -&gt; [(Name ann, [FieldLine ann])]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679701992"><span class="hs-identifier hs-var">efs</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679701991"><span class="hs-identifier hs-var">r'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-851"></span><span>        </span><span class="annot"><a href="#local-6989586621679702004"><span class="hs-identifier hs-var">toExe</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe (Field ann, [(Name ann, [FieldLine ann])])
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unexpected input to 'toExe'&quot;</span></span><span>
</span><span id="line-852"></span><span>
</span><span id="line-853"></span><span>        </span><span id="local-6989586621679701988"><span class="annot"><span class="annottext">lib :: [Field ann]
</span><a href="#local-6989586621679701988"><span class="hs-identifier hs-var hs-var">lib</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702007"><span class="hs-identifier hs-var">libfs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-854"></span><span>            </span><span class="hs-special">[</span><span class="hs-special">]</span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-855"></span><span>            </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span id="local-6989586621679701987"><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679701987"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">[FieldLine ann]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-856"></span><span>                </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name ann -&gt; [SectionArg ann] -&gt; [Field ann] -&gt; Field ann
forall ann.
Name ann -&gt; [SectionArg ann] -&gt; [Field ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Section"><span class="hs-identifier hs-var">Section</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ann -&gt; ByteString -&gt; Name ann
forall ann. ann -&gt; ByteString -&gt; Name ann
</span><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-var">Name</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679701987"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;library&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Name ann, [FieldLine ann]) -&gt; Field ann)
-&gt; [(Name ann, [FieldLine ann])] -&gt; [Field ann]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann, [FieldLine ann]) -&gt; Field ann
forall {ann}. (Name ann, [FieldLine ann]) -&gt; Field ann
</span><a href="#local-6989586621679702026"><span class="hs-identifier hs-var">toField</span></a></span><span> </span><span class="annot"><span class="annottext">([(Name ann, [FieldLine ann])] -&gt; [Field ann])
-&gt; [(Name ann, [FieldLine ann])] -&gt; [Field ann]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702008"><span class="hs-identifier hs-var">deps</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
-&gt; [(Name ann, [FieldLine ann])] -&gt; [(Name ann, [FieldLine ann])]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702007"><span class="hs-identifier hs-var">libfs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-857"></span><span>
</span><span id="line-858"></span><span>      </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">((Name ann, [FieldLine ann]) -&gt; Field ann)
-&gt; [(Name ann, [FieldLine ann])] -&gt; [Field ann]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Name ann, [FieldLine ann]) -&gt; Field ann
forall {ann}. (Name ann, [FieldLine ann]) -&gt; Field ann
</span><a href="#local-6989586621679702026"><span class="hs-identifier hs-var">toField</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name ann, [FieldLine ann])]
</span><a href="#local-6989586621679702016"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="annot"><span class="annottext">[Field ann] -&gt; [Field ann] -&gt; [Field ann]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Field ann]
</span><a href="#local-6989586621679701988"><span class="hs-identifier hs-var">lib</span></a></span><span> </span><span class="annot"><span class="annottext">[Field ann] -&gt; [Field ann] -&gt; [Field ann]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Field ann]
</span><a href="#local-6989586621679702006"><span class="hs-identifier hs-var">exes</span></a></span><span>
</span><span id="line-859"></span><span>
</span><span id="line-860"></span><span class="hs-comment">-- | See 'sectionizeFields'.</span><span>
</span><span id="line-861"></span><span class="hs-keyword">data</span><span> </span><span id="Syntax"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#Syntax"><span class="hs-identifier hs-var">Syntax</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="OldSyntax"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#OldSyntax"><span class="hs-identifier hs-var">OldSyntax</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="NewSyntax"><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#NewSyntax"><span class="hs-identifier hs-var">NewSyntax</span></a></span></span><span>
</span><span id="line-862"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679701983"><span id="local-6989586621679701985"><span class="annot"><span class="annottext">Syntax -&gt; Syntax -&gt; Bool
(Syntax -&gt; Syntax -&gt; Bool)
-&gt; (Syntax -&gt; Syntax -&gt; Bool) -&gt; Eq Syntax
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Syntax -&gt; Syntax -&gt; Bool
$c/= :: Syntax -&gt; Syntax -&gt; Bool
== :: Syntax -&gt; Syntax -&gt; Bool
$c== :: Syntax -&gt; Syntax -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701976"><span id="local-6989586621679701978"><span id="local-6989586621679701980"><span class="annot"><span class="annottext">Int -&gt; Syntax -&gt; String -&gt; String
[Syntax] -&gt; String -&gt; String
Syntax -&gt; String
(Int -&gt; Syntax -&gt; String -&gt; String)
-&gt; (Syntax -&gt; String)
-&gt; ([Syntax] -&gt; String -&gt; String)
-&gt; Show Syntax
forall a.
(Int -&gt; a -&gt; String -&gt; String)
-&gt; (a -&gt; String) -&gt; ([a] -&gt; String -&gt; String) -&gt; Show a
showList :: [Syntax] -&gt; String -&gt; String
$cshowList :: [Syntax] -&gt; String -&gt; String
show :: Syntax -&gt; String
$cshow :: Syntax -&gt; String
showsPrec :: Int -&gt; Syntax -&gt; String -&gt; String
$cshowsPrec :: Int -&gt; Syntax -&gt; String -&gt; String
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-863"></span><span>
</span><span id="line-864"></span><span class="hs-comment">-- TODO:</span><span>
</span><span id="line-865"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#libFieldNames"><span class="hs-identifier hs-type">libFieldNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldName"><span class="hs-identifier hs-type">FieldName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-866"></span><span id="libFieldNames"><span class="annot"><span class="annottext">libFieldNames :: [ByteString]
</span><a href="Distribution.PackageDescription.Parsec.html#libFieldNames"><span class="hs-identifier hs-var hs-var">libFieldNames</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' Library -&gt; [ByteString]
forall s a. ParsecFieldGrammar s a -&gt; [ByteString]
</span><a href="Distribution.FieldGrammar.Parsec.html#fieldGrammarKnownFieldList"><span class="hs-identifier hs-var">fieldGrammarKnownFieldList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LibraryName -&gt; ParsecFieldGrammar' Library
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g Library),
 Applicative (g BuildInfo), c (Identity LibraryVisibility),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List CommaVCat (Identity ModuleReexport) ModuleReexport),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
LibraryName -&gt; g Library Library
</span><a href="Distribution.PackageDescription.FieldGrammar.html#libraryFieldGrammar"><span class="hs-identifier hs-var">libraryFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="Distribution.Types.LibraryName.html#LMainLibName"><span class="hs-identifier hs-var">LMainLibName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-867"></span><span>
</span><span id="line-868"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-869"></span><span class="hs-comment">-- Suplementary build information</span><span>
</span><span id="line-870"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-871"></span><span>
</span><span id="line-872"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#readHookedBuildInfo"><span class="hs-identifier hs-type">readHookedBuildInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="Distribution.Types.HookedBuildInfo.html#HookedBuildInfo"><span class="hs-identifier hs-type">HookedBuildInfo</span></a></span><span>
</span><span id="line-873"></span><span id="readHookedBuildInfo"><span class="annot"><span class="annottext">readHookedBuildInfo :: Verbosity -&gt; String -&gt; IO HookedBuildInfo
</span><a href="Distribution.PackageDescription.Parsec.html#readHookedBuildInfo"><span class="hs-identifier hs-var hs-var">readHookedBuildInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ParseResult HookedBuildInfo)
-&gt; Verbosity -&gt; String -&gt; IO HookedBuildInfo
forall a.
(ByteString -&gt; ParseResult a) -&gt; Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Fields.ParseResult.html#readAndParseFile"><span class="hs-identifier hs-var">readAndParseFile</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ParseResult HookedBuildInfo
</span><a href="Distribution.PackageDescription.Parsec.html#parseHookedBuildInfo"><span class="hs-identifier hs-var">parseHookedBuildInfo</span></a></span><span>
</span><span id="line-874"></span><span>
</span><span id="line-875"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseHookedBuildInfo"><span class="hs-identifier hs-type">parseHookedBuildInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.HookedBuildInfo.html#HookedBuildInfo"><span class="hs-identifier hs-type">HookedBuildInfo</span></a></span><span>
</span><span id="line-876"></span><span id="parseHookedBuildInfo"><span class="annot"><span class="annottext">parseHookedBuildInfo :: ByteString -&gt; ParseResult HookedBuildInfo
</span><a href="Distribution.PackageDescription.Parsec.html#parseHookedBuildInfo"><span class="hs-identifier hs-var hs-var">parseHookedBuildInfo</span></a></span></span><span> </span><span id="local-6989586621679701973"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701973"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Either ParseError ([Field Position], [LexWarning])
</span><a href="Distribution.Fields.Parser.html#readFields%27"><span class="hs-identifier hs-var">readFields'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701973"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-877"></span><span>    </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679701972"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701972"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701971"><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679701971"><span class="hs-identifier hs-var">lexWarnings</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-878"></span><span>        </span><span class="annot"><span class="annottext">[LexWarning] -&gt; [Field Position] -&gt; ParseResult HookedBuildInfo
</span><a href="Distribution.PackageDescription.Parsec.html#parseHookedBuildInfo%27"><span class="hs-identifier hs-var">parseHookedBuildInfo'</span></a></span><span> </span><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679701971"><span class="hs-identifier hs-var">lexWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701972"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-879"></span><span>    </span><span class="hs-comment">-- TODO: better marshalling of errors</span><span>
</span><span id="line-880"></span><span>    </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679701969"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679701969"><span class="hs-identifier hs-var">perr</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Position -&gt; String -&gt; ParseResult HookedBuildInfo
forall a. Position -&gt; String -&gt; ParseResult a
</span><a href="Distribution.Fields.ParseResult.html#parseFatalFailure"><span class="hs-identifier hs-var">parseFatalFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679701969"><span class="hs-identifier hs-var">perr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-881"></span><span>
</span><span id="line-882"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#parseHookedBuildInfo%27"><span class="hs-identifier hs-type">parseHookedBuildInfo'</span></a></span><span>
</span><span id="line-883"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexWarning"><span class="hs-identifier hs-type">LexWarning</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-884"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-885"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.HookedBuildInfo.html#HookedBuildInfo"><span class="hs-identifier hs-type">HookedBuildInfo</span></a></span><span>
</span><span id="line-886"></span><span id="parseHookedBuildInfo%27"><span class="annot"><span class="annottext">parseHookedBuildInfo' :: [LexWarning] -&gt; [Field Position] -&gt; ParseResult HookedBuildInfo
</span><a href="Distribution.PackageDescription.Parsec.html#parseHookedBuildInfo%27"><span class="hs-identifier hs-var hs-var">parseHookedBuildInfo'</span></a></span></span><span> </span><span id="local-6989586621679701968"><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679701968"><span class="hs-identifier hs-var">lexWarnings</span></a></span></span><span> </span><span id="local-6989586621679701967"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701967"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-887"></span><span>    </span><span class="annot"><span class="annottext">[PWarning] -&gt; ParseResult ()
</span><a href="Distribution.Fields.ParseResult.html#parseWarnings"><span class="hs-identifier hs-var">parseWarnings</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LexWarning] -&gt; [PWarning]
</span><a href="Distribution.Fields.LexerMonad.html#toPWarnings"><span class="hs-identifier hs-var">toPWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679701968"><span class="hs-identifier hs-var">lexWarnings</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-888"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679701966"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701966"><span class="hs-identifier hs-var">mLibFields</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701965"><span class="annot"><span class="annottext">[(UnqualComponentName, Fields Position)]
</span><a href="#local-6989586621679701965"><span class="hs-identifier hs-var">exes</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Field Position]
-&gt; ParseResult
     (Fields Position, [(UnqualComponentName, Fields Position)])
</span><a href="#local-6989586621679701964"><span class="hs-identifier hs-var">stanzas</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701967"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-889"></span><span>    </span><span id="local-6989586621679701963"><span class="annot"><span class="annottext">Maybe BuildInfo
</span><a href="#local-6989586621679701963"><span class="hs-identifier hs-var">mLib</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Fields Position -&gt; ParseResult (Maybe BuildInfo)
</span><a href="#local-6989586621679701962"><span class="hs-identifier hs-var">parseLib</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701966"><span class="hs-identifier hs-var">mLibFields</span></a></span><span>
</span><span id="line-890"></span><span>    </span><span id="local-6989586621679701961"><span class="annot"><span class="annottext">[(UnqualComponentName, BuildInfo)]
</span><a href="#local-6989586621679701961"><span class="hs-identifier hs-var">biExes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((UnqualComponentName, Fields Position)
 -&gt; ParseResult (UnqualComponentName, BuildInfo))
-&gt; [(UnqualComponentName, Fields Position)]
-&gt; ParseResult [(UnqualComponentName, BuildInfo)]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">(UnqualComponentName, Fields Position)
-&gt; ParseResult (UnqualComponentName, BuildInfo)
</span><a href="#local-6989586621679701960"><span class="hs-identifier hs-var">parseExe</span></a></span><span> </span><span class="annot"><span class="annottext">[(UnqualComponentName, Fields Position)]
</span><a href="#local-6989586621679701965"><span class="hs-identifier hs-var">exes</span></a></span><span>
</span><span id="line-891"></span><span>    </span><span class="annot"><span class="annottext">HookedBuildInfo -&gt; ParseResult HookedBuildInfo
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe BuildInfo
</span><a href="#local-6989586621679701963"><span class="hs-identifier hs-var">mLib</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(UnqualComponentName, BuildInfo)]
</span><a href="#local-6989586621679701961"><span class="hs-identifier hs-var">biExes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-892"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-893"></span><span>    </span><span class="annot"><a href="#local-6989586621679701962"><span class="hs-identifier hs-type">parseLib</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Fields"><span class="hs-identifier hs-type">Fields</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-894"></span><span>    </span><span id="local-6989586621679701962"><span class="annot"><span class="annottext">parseLib :: Fields Position -&gt; ParseResult (Maybe BuildInfo)
</span><a href="#local-6989586621679701962"><span class="hs-identifier hs-var hs-var">parseLib</span></a></span></span><span> </span><span id="local-6989586621679701959"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701959"><span class="hs-identifier hs-var">fields</span></a></span></span><span>
</span><span id="line-895"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Fields Position -&gt; Bool
forall k a. Map k a -&gt; Bool
</span><a href="../../containers/src/Data.Map.Internal.html#null"><span class="hs-identifier hs-var">Map.null</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701959"><span class="hs-identifier hs-var">fields</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BuildInfo -&gt; ParseResult (Maybe BuildInfo)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BuildInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-896"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; Maybe BuildInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(BuildInfo -&gt; Maybe BuildInfo)
-&gt; ParseResult BuildInfo -&gt; ParseResult (Maybe BuildInfo)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Fields Position
-&gt; ParsecFieldGrammar' BuildInfo
-&gt; ParseResult BuildInfo
forall s a.
CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar s a -&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#parseFieldGrammar"><span class="hs-identifier hs-var">parseFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#cabalSpecLatest"><span class="hs-identifier hs-var">cabalSpecLatest</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701959"><span class="hs-identifier hs-var">fields</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' BuildInfo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g BuildInfo),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
g BuildInfo BuildInfo
</span><a href="Distribution.PackageDescription.FieldGrammar.html#buildInfoFieldGrammar"><span class="hs-identifier hs-var">buildInfoFieldGrammar</span></a></span><span>
</span><span id="line-897"></span><span>
</span><span id="line-898"></span><span>    </span><span class="annot"><a href="#local-6989586621679701960"><span class="hs-identifier hs-type">parseExe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.UnqualComponentName.html#UnqualComponentName"><span class="hs-identifier hs-type">UnqualComponentName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Fields"><span class="hs-identifier hs-type">Fields</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.UnqualComponentName.html#UnqualComponentName"><span class="hs-identifier hs-type">UnqualComponentName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-899"></span><span>    </span><span id="local-6989586621679701960"><span class="annot"><span class="annottext">parseExe :: (UnqualComponentName, Fields Position)
-&gt; ParseResult (UnqualComponentName, BuildInfo)
</span><a href="#local-6989586621679701960"><span class="hs-identifier hs-var hs-var">parseExe</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679701956"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679701956"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701955"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701955"><span class="hs-identifier hs-var">fields</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-900"></span><span>        </span><span id="local-6989586621679701954"><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679701954"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Fields Position
-&gt; ParsecFieldGrammar' BuildInfo
-&gt; ParseResult BuildInfo
forall s a.
CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar s a -&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#parseFieldGrammar"><span class="hs-identifier hs-var">parseFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#cabalSpecLatest"><span class="hs-identifier hs-var">cabalSpecLatest</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701955"><span class="hs-identifier hs-var">fields</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar' BuildInfo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g BuildInfo),
 c (List CommaFSep (Identity ExeDependency) ExeDependency),
 c (List
      CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
 c (List
      CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
 c (List CommaVCat (Identity Dependency) Dependency),
 c (List CommaVCat (Identity Mixin) Mixin),
 c (List FSep (MQuoted Extension) Extension),
 c (List FSep (MQuoted Language) Language),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (List NoCommaFSep Token' String),
 c (List VCat (MQuoted ModuleName) ModuleName),
 c (List VCat FilePathNT String), c (List VCat Token String),
 c (MQuoted Language)) =&gt;
g BuildInfo BuildInfo
</span><a href="Distribution.PackageDescription.FieldGrammar.html#buildInfoFieldGrammar"><span class="hs-identifier hs-var">buildInfoFieldGrammar</span></a></span><span>
</span><span id="line-901"></span><span>        </span><span class="annot"><span class="annottext">(UnqualComponentName, BuildInfo)
-&gt; ParseResult (UnqualComponentName, BuildInfo)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679701956"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679701954"><span class="hs-identifier hs-var">bi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-902"></span><span>
</span><span id="line-903"></span><span>    </span><span class="annot"><a href="#local-6989586621679701964"><span class="hs-identifier hs-type">stanzas</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Fields"><span class="hs-identifier hs-type">Fields</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.UnqualComponentName.html#UnqualComponentName"><span class="hs-identifier hs-type">UnqualComponentName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Fields"><span class="hs-identifier hs-type">Fields</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-904"></span><span>    </span><span id="local-6989586621679701964"><span class="annot"><span class="annottext">stanzas :: [Field Position]
-&gt; ParseResult
     (Fields Position, [(UnqualComponentName, Fields Position)])
</span><a href="#local-6989586621679701964"><span class="hs-identifier hs-var hs-var">stanzas</span></a></span></span><span> </span><span id="local-6989586621679701953"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701953"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-905"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679701952"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701952"><span class="hs-identifier hs-var">hdr0</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701951"><span class="annot"><span class="annottext">Maybe ([FieldLine Position], [Field Position])
</span><a href="#local-6989586621679701951"><span class="hs-identifier hs-var">exes0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Field Position -&gt; Maybe [FieldLine Position])
-&gt; [Field Position]
-&gt; ([Field Position],
    Maybe ([FieldLine Position], [Field Position]))
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; ([a], Maybe (b, [a]))
</span><a href="Distribution.Utils.Generic.html#breakMaybe"><span class="hs-identifier hs-var">breakMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Field Position -&gt; Maybe [FieldLine Position]
forall {ann}. Field ann -&gt; Maybe [FieldLine ann]
</span><a href="#local-6989586621679701950"><span class="hs-identifier hs-var">isExecutableField</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701953"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-906"></span><span>        </span><span id="local-6989586621679701949"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701949"><span class="hs-identifier hs-var">hdr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; ParseResult (Fields Position)
</span><a href="#local-6989586621679701948"><span class="hs-identifier hs-var">toFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701952"><span class="hs-identifier hs-var">hdr0</span></a></span><span>
</span><span id="line-907"></span><span>        </span><span id="local-6989586621679701947"><span class="annot"><span class="annottext">[(UnqualComponentName, Fields Position)]
</span><a href="#local-6989586621679701947"><span class="hs-identifier hs-var">exes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Maybe ([FieldLine Position], [Field Position])
 -&gt; ParseResult
      (Maybe
         ((UnqualComponentName, Fields Position),
          Maybe ([FieldLine Position], [Field Position]))))
-&gt; Maybe ([FieldLine Position], [Field Position])
-&gt; ParseResult [(UnqualComponentName, Fields Position)]
forall (m :: * -&gt; *) b a.
Monad m =&gt;
(b -&gt; m (Maybe (a, b))) -&gt; b -&gt; m [a]
</span><a href="Distribution.Utils.Generic.html#unfoldrM"><span class="hs-identifier hs-var">unfoldrM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(([FieldLine Position], [Field Position])
 -&gt; ParseResult
      ((UnqualComponentName, Fields Position),
       Maybe ([FieldLine Position], [Field Position])))
-&gt; Maybe ([FieldLine Position], [Field Position])
-&gt; ParseResult
     (Maybe
        ((UnqualComponentName, Fields Position),
         Maybe ([FieldLine Position], [Field Position])))
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">([FieldLine Position], [Field Position])
-&gt; ParseResult
     ((UnqualComponentName, Fields Position),
      Maybe ([FieldLine Position], [Field Position]))
</span><a href="#local-6989586621679701946"><span class="hs-identifier hs-var">toExe</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe ([FieldLine Position], [Field Position])
</span><a href="#local-6989586621679701951"><span class="hs-identifier hs-var">exes0</span></a></span><span>
</span><span id="line-908"></span><span>        </span><span class="annot"><span class="annottext">(Fields Position, [(UnqualComponentName, Fields Position)])
-&gt; ParseResult
     (Fields Position, [(UnqualComponentName, Fields Position)])
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701949"><span class="hs-identifier hs-var">hdr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(UnqualComponentName, Fields Position)]
</span><a href="#local-6989586621679701947"><span class="hs-identifier hs-var">exes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-909"></span><span>
</span><span id="line-910"></span><span>    </span><span class="annot"><a href="#local-6989586621679701948"><span class="hs-identifier hs-type">toFields</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Fields"><span class="hs-identifier hs-type">Fields</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-911"></span><span>    </span><span id="local-6989586621679701948"><span class="annot"><span class="annottext">toFields :: [Field Position] -&gt; ParseResult (Fields Position)
</span><a href="#local-6989586621679701948"><span class="hs-identifier hs-var hs-var">toFields</span></a></span></span><span> </span><span id="local-6989586621679701945"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701945"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-912"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679701944"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701944"><span class="hs-identifier hs-var">fields'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701943"><span class="annot"><span class="annottext">[[Section Position]]
</span><a href="#local-6989586621679701943"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; (Fields Position, [[Section Position]])
forall ann. [Field ann] -&gt; (Fields ann, [[Section ann]])
</span><a href="Distribution.FieldGrammar.html#partitionFields"><span class="hs-identifier hs-var">partitionFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701945"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-913"></span><span>        </span><span class="annot"><span class="annottext">([Section Position] -&gt; ParseResult ())
-&gt; [[Section Position]] -&gt; ParseResult ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#traverse_"><span class="hs-identifier hs-var">traverse_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Section Position -&gt; ParseResult ())
-&gt; [Section Position] -&gt; ParseResult ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#traverse_"><span class="hs-identifier hs-var">traverse_</span></a></span><span> </span><span class="annot"><span class="annottext">Section Position -&gt; ParseResult ()
</span><a href="Distribution.PackageDescription.Parsec.html#warnInvalidSubsection"><span class="hs-identifier hs-var">warnInvalidSubsection</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[[Section Position]]
</span><a href="#local-6989586621679701943"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-914"></span><span>        </span><span class="annot"><span class="annottext">Fields Position -&gt; ParseResult (Fields Position)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701944"><span class="hs-identifier hs-var">fields'</span></a></span><span>
</span><span id="line-915"></span><span>
</span><span id="line-916"></span><span>    </span><span class="annot"><a href="#local-6989586621679701946"><span class="hs-identifier hs-type">toExe</span></a></span><span>
</span><span id="line-917"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-type">FieldLine</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-918"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.ParseResult.html#ParseResult"><span class="hs-identifier hs-type">ParseResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.UnqualComponentName.html#UnqualComponentName"><span class="hs-identifier hs-type">UnqualComponentName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.Parsec.html#Fields"><span class="hs-identifier hs-type">Fields</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-type">FieldLine</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-919"></span><span>    </span><span id="local-6989586621679701946"><span class="annot"><span class="annottext">toExe :: ([FieldLine Position], [Field Position])
-&gt; ParseResult
     ((UnqualComponentName, Fields Position),
      Maybe ([FieldLine Position], [Field Position]))
</span><a href="#local-6989586621679701946"><span class="hs-identifier hs-var hs-var">toExe</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679701942"><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679701942"><span class="hs-identifier hs-var">fss</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701941"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701941"><span class="hs-identifier hs-var">fields</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-920"></span><span>        </span><span id="local-6989586621679701940"><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679701940"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Position
-&gt; ParsecParser UnqualComponentName
-&gt; CabalSpecVersion
-&gt; [FieldLine Position]
-&gt; ParseResult UnqualComponentName
forall a.
Position
-&gt; ParsecParser a
-&gt; CabalSpecVersion
-&gt; [FieldLine Position]
-&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#runFieldParser"><span class="hs-identifier hs-var">runFieldParser</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="Distribution.Parsec.Position.html#zeroPos"><span class="hs-identifier hs-var">zeroPos</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecParser UnqualComponentName
forall a (m :: * -&gt; *). (Parsec a, CabalParsing m) =&gt; m a
</span><a href="Distribution.Parsec.html#parsec"><span class="hs-identifier hs-var">parsec</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#cabalSpecLatest"><span class="hs-identifier hs-var">cabalSpecLatest</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679701942"><span class="hs-identifier hs-var">fss</span></a></span><span>
</span><span id="line-921"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679701939"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701939"><span class="hs-identifier hs-var">hdr0</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679701938"><span class="annot"><span class="annottext">Maybe ([FieldLine Position], [Field Position])
</span><a href="#local-6989586621679701938"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Field Position -&gt; Maybe [FieldLine Position])
-&gt; [Field Position]
-&gt; ([Field Position],
    Maybe ([FieldLine Position], [Field Position]))
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; ([a], Maybe (b, [a]))
</span><a href="Distribution.Utils.Generic.html#breakMaybe"><span class="hs-identifier hs-var">breakMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Field Position -&gt; Maybe [FieldLine Position]
forall {ann}. Field ann -&gt; Maybe [FieldLine ann]
</span><a href="#local-6989586621679701950"><span class="hs-identifier hs-var">isExecutableField</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701941"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-922"></span><span>        </span><span id="local-6989586621679701937"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701937"><span class="hs-identifier hs-var">hdr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; ParseResult (Fields Position)
</span><a href="#local-6989586621679701948"><span class="hs-identifier hs-var">toFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679701939"><span class="hs-identifier hs-var">hdr0</span></a></span><span>
</span><span id="line-923"></span><span>        </span><span class="annot"><span class="annottext">((UnqualComponentName, Fields Position),
 Maybe ([FieldLine Position], [Field Position]))
-&gt; ParseResult
     ((UnqualComponentName, Fields Position),
      Maybe ([FieldLine Position], [Field Position]))
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnqualComponentName
</span><a href="#local-6989586621679701940"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679701937"><span class="hs-identifier hs-var">hdr</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe ([FieldLine Position], [Field Position])
</span><a href="#local-6989586621679701938"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-924"></span><span>
</span><span id="line-925"></span><span>    </span><span id="local-6989586621679701950"><span class="annot"><span class="annottext">isExecutableField :: Field ann -&gt; Maybe [FieldLine ann]
</span><a href="#local-6989586621679701950"><span class="hs-identifier hs-var hs-var">isExecutableField</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679701934"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701934"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679701933"><span class="annot"><span class="annottext">[FieldLine ann]
</span><a href="#local-6989586621679701933"><span class="hs-identifier hs-var">fss</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-926"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701934"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;executable&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FieldLine ann] -&gt; Maybe [FieldLine ann]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine ann]
</span><a href="#local-6989586621679701933"><span class="hs-identifier hs-var">fss</span></a></span><span>
</span><span id="line-927"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [FieldLine ann]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-928"></span><span>    </span><span class="annot"><a href="#local-6989586621679701950"><span class="hs-identifier hs-var">isExecutableField</span></a></span><span> </span><span class="annot"><span class="annottext">Field ann
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [FieldLine ann]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-929"></span><span>
</span><span id="line-930"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-931"></span><span class="hs-comment">-- Scan of spec version</span><span>
</span><span id="line-932"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-933"></span><span>
</span><span id="line-934"></span><span class="hs-comment">-- | Quickly scan new-style spec-version</span><span>
</span><span id="line-935"></span><span class="hs-comment">--</span><span>
</span><span id="line-936"></span><span class="hs-comment">-- A new-style spec-version declaration begins the .cabal file and</span><span>
</span><span id="line-937"></span><span class="hs-comment">-- follow the following case-insensitive grammar (expressed in</span><span>
</span><span id="line-938"></span><span class="hs-comment">-- RFC5234 ABNF):</span><span>
</span><span id="line-939"></span><span class="hs-comment">--</span><span>
</span><span id="line-940"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-941"></span><span class="hs-comment">-- newstyle-spec-version-decl = &quot;cabal-version&quot; *WS &quot;:&quot; *WS newstyle-pec-version *WS</span><span>
</span><span id="line-942"></span><span class="hs-comment">--</span><span>
</span><span id="line-943"></span><span class="hs-comment">-- spec-version               = NUM &quot;.&quot; NUM [ &quot;.&quot; NUM ]</span><span>
</span><span id="line-944"></span><span class="hs-comment">--</span><span>
</span><span id="line-945"></span><span class="hs-comment">-- NUM    = DIGIT0 / DIGITP 1*DIGIT0</span><span>
</span><span id="line-946"></span><span class="hs-comment">-- DIGIT0 = %x30-39</span><span>
</span><span id="line-947"></span><span class="hs-comment">-- DIGITP = %x31-39</span><span>
</span><span id="line-948"></span><span class="hs-comment">-- WS = %20</span><span>
</span><span id="line-949"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-950"></span><span class="hs-comment">--</span><span>
</span><span id="line-951"></span><span class="annot"><a href="Distribution.PackageDescription.Parsec.html#scanSpecVersion"><span class="hs-identifier hs-type">scanSpecVersion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span>
</span><span id="line-952"></span><span id="scanSpecVersion"><span class="annot"><span class="annottext">scanSpecVersion :: ByteString -&gt; Maybe Version
</span><a href="Distribution.PackageDescription.Parsec.html#scanSpecVersion"><span class="hs-identifier hs-var hs-var">scanSpecVersion</span></a></span></span><span> </span><span id="local-6989586621679701932"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701932"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-953"></span><span>    </span><span id="local-6989586621679701931"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701931"><span class="hs-identifier hs-var">fstline'</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[ByteString]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Maybe [ByteString]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#lines"><span class="hs-identifier hs-var">BS8.lines</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701932"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-954"></span><span>
</span><span id="line-955"></span><span>    </span><span class="hs-comment">-- parse &lt;newstyle-spec-version-decl&gt;</span><span>
</span><span id="line-956"></span><span>    </span><span class="hs-comment">-- normalise: remove all whitespace, convert to lower-case</span><span>
</span><span id="line-957"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679701927"><span class="annot"><span class="annottext">fstline :: ByteString
</span><a href="#local-6989586621679701927"><span class="hs-identifier hs-var hs-var">fstline</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Word8) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#map"><span class="hs-identifier hs-var">BS.map</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8
</span><a href="#local-6989586621679701925"><span class="hs-identifier hs-var">toLowerW8</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString) -&gt; ByteString -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#filter"><span class="hs-identifier hs-var">BS.filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x20</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701931"><span class="hs-identifier hs-var">fstline'</span></a></span><span>
</span><span id="line-958"></span><span>    </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;cabal-version&quot;</span></span><span class="hs-special">,</span><span id="local-6989586621679701923"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701923"><span class="hs-identifier hs-var">vers</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Maybe [ByteString]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; ByteString -&gt; [ByteString]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#split"><span class="hs-identifier hs-var">BS8.split</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">':'</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701927"><span class="hs-identifier hs-var">fstline</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-959"></span><span>
</span><span id="line-960"></span><span>    </span><span class="hs-comment">-- parse &lt;spec-version&gt;</span><span>
</span><span id="line-961"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-962"></span><span>    </span><span class="hs-comment">-- This is currently more tolerant regarding leading 0 digits.</span><span>
</span><span id="line-963"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-964"></span><span>    </span><span id="local-6989586621679701921"><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679701921"><span class="hs-identifier hs-var">ver</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe Version
forall a. Parsec a =&gt; ByteString -&gt; Maybe a
</span><a href="Distribution.Parsec.html#simpleParsecBS"><span class="hs-identifier hs-var">simpleParsecBS</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679701923"><span class="hs-identifier hs-var">vers</span></a></span><span>
</span><span id="line-965"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Maybe ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Maybe ()) -&gt; Bool -&gt; Maybe ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Version -&gt; [Int]
</span><a href="Distribution.Types.Version.html#versionNumbers"><span class="hs-identifier hs-var">versionNumbers</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679701921"><span class="hs-identifier hs-var">ver</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-966"></span><span>              </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-967"></span><span>              </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-968"></span><span>              </span><span class="annot"><span class="annottext">[Int]
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-969"></span><span>
</span><span id="line-970"></span><span>    </span><span class="annot"><span class="annottext">Version -&gt; Maybe Version
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679701921"><span class="hs-identifier hs-var">ver</span></a></span><span>
</span><span id="line-971"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-972"></span><span>    </span><span class="hs-comment">-- | Translate ['A'..'Z'] to ['a'..'z']</span><span>
</span><span id="line-973"></span><span>    </span><span class="annot"><a href="#local-6989586621679701925"><span class="hs-identifier hs-type">toLowerW8</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span>
</span><span id="line-974"></span><span>    </span><span id="local-6989586621679701925"><span class="annot"><span class="annottext">toLowerW8 :: Word8 -&gt; Word8
</span><a href="#local-6989586621679701925"><span class="hs-identifier hs-var hs-var">toLowerW8</span></a></span></span><span> </span><span id="local-6989586621679701920"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679701920"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x40</span></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679701920"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679701920"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x5b</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679701920"><span class="hs-identifier hs-var">w</span></a></span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x20</span></span><span>
</span><span id="line-975"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679701920"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-976"></span></pre></body></html>